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翻譯解決我的應用程序特定關鍵短語時遇到的問題。