在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):gillesdemey/google-speech-v2开源软件地址(OpenSource Url):https://github.com/gillesdemey/google-speech-v2开源编程语言(OpenSource Language):开源软件介绍(OpenSource Introduction):Google Speech API v2:NOTICEGoogle has since launched it's official Google Cloud Speech API. I strongly recommend looking over there. Host:https://www.google.com/speech-api/v2/recognize Parametersoutput: json, xml not supported. lang: any valid locale (en-us, nl-be, fr-fr, etc.) key: Please get one from the Google Developers Console Key is not optional. app: optional You can specify an optional query string called client: optional, seems to do nothing in particular Data:FLACFlac file; 44100Hz 32bit float, exported with Audacity. Check the audio folder in this repository for some hilarious examples.
16-bit PCMThe following audio options are confirmed working for 16-bit PCM sample encoding:
One-line sox recording command:
Headers:Content-Type:
Set the rate to be equal to the rate of the FLAC file (generally 44100Hz) but it supports different rates.
NOTE: Make sure the rate in your header matches the sample rate you used for your audio capture. User-Agent: not required, but for spoofing purposes use one of Chrome’s userAgent strings. Response:When Google is 100% confident in it's translation, it will return the following object: {
"result":[
{
"alternative":[
{
"transcript":"good morning Google how are you feeling today"
}
],
"final":true
}
],
"result_index":0
} When it's doubtful, it adds a confidence parameter for you. It also seems to add multiple transcripts for some reason. {
"result":[
{
"alternative":[
{
"transcript":"this is a test",
"confidence":0.97321892
},
{
"transcript":"this is a test for"
}
],
"final":true
}
],
"result_index":0
} ExampleInstall soxOn OS X with Homebrew installed:
Record audio
Send the request
Or for FLAC encoded audio:
CaveatsHere are a few caveats you have to know about, should you decide to use this API in a production environment. (I don't recommend it)
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论