How to receive answer from Google Assistant as a String, not as an audio stream

社会主义新天地 提交于 2020-01-04 03:44:07

问题


I am using the python libraries from the Assistant SDK for speech recognition via gRPC. I have the speech recognized and returned as a string calling the method resp.result.spoken_request_text from \googlesamples\assistant\__main__.py and I have the answer as an audio stream from the assistant API with the method resp.audio_out.audio_data also from \googlesamples\assistant\__main__.py

I would like to know if it is possible to have the answer from the service as a string as well (hoping it is available in the service definition or that it could be included), and how I could access/request the answer as string.

Thanks in advance.


回答1:


Currently (Assistant SDK Developer Preview 1), there is no direct way to do this. You can probably feed the audio stream into a Speech-to-Text system, but that really starts getting silly.

Speaking to the engineers on this subject while at Google I/O, they indicated that there are some technical complications on their end to doing this, but they understand the use cases. They need to see questions like this to know that people want the feature.

Hopefully it will make it into an upcoming Developer Preview.




回答2:


Update: for

google.assistant.embedded.v1alpha2

the assistant SDK includes the field supplemental_display_text

which is meant to extract the assistant response as text which aids the user's understanding

or to be displayed on screens. Still making the text available to the developer. Goolge assistant documentation



来源:https://stackoverflow.com/questions/44123641/how-to-receive-answer-from-google-assistant-as-a-string-not-as-an-audio-stream

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!