Google Speech API V2

限于喜欢 提交于 2019-12-02 15:58:36
Gui Ambros

You have to be a member of chromium-dev discussion list before you can enable the Speech API in your Google Developers Console.

  1. Go to Chromium Dev group and click Join the list. Do not post to the group regarding the Google Speech API, as it is completely off topic.

  2. Go back to Google Developers Console, select your project, enter APIs & Auth / APIs. You'll now see Speech API. Click to enable it.

  3. Go to Credentials, Create new Key, Server Key. You may optionally specify a list of IPs, for security.

You now may make queries to Google Speech API v2. Keep in mind that this is an experimental API, and limited to 50 queries per day per project.

Here's an example (using Linux):

arecord -D plughw:2,0 -f cd -t wav -d 10 -r 16000 | \
flac - -f --best --sample-rate 16000 -o out.flac; \
wget -O - -o /dev/null --post-file out.flac --header="Content-Type: audio/x-flac; rate=16000" \
"http://www.google.com/speech-api/v2/recognize?lang=en-us&key=ADD_YOUR_KEY_HERE&output=json" | \
sed -e 's/[{}]/''/g'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!