2
我整合谷歌云Speechem我的应用程序,并想用SpeechContext的文档中描述的特征:https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1#speechcontext如何使用SpeechContext到谷歌云语音
有没有人有一个想法(教程)如何使用此功能SpeechContext?
Tks!
蒂亚戈
我整合谷歌云Speechem我的应用程序,并想用SpeechContext的文档中描述的特征:https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1#speechcontext如何使用SpeechContext到谷歌云语音
有没有人有一个想法(教程)如何使用此功能SpeechContext?
Tks!
蒂亚戈
这是我如何形成JSON有效载荷包括SpeechContext提供关键短语,在这种情况下“烤土豆”和“kerfuffle的”:
{
"config": {
"encoding": "LINEAR16",
"sampleRateHertz": 16000,
"languageCode": locale,
"speechContexts": [
{
"phrases": [
"baked potato",
"kerfuffle",
],
}
],
},
"audio": {
"content": encoded_audio,
}
}
其中locale
是一个变量保持语言代码和encoded_audio
是保存音频的字节字符串。
提供此语音上下文很好地解决了Google翻译解决我的应用程序特定关键短语时遇到的问题。