本文介绍了android things:使用语音在Raspberry Pi 3中使用android things发送文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用下面的代码将 Raspberry Pi3 的语音转为文本

im using below code for speech to text for Raspberry Pi3

   Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
                intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                        RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
                intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "en-US");


                try {

                    startActivityForResult(intent, RESULT_SPEECH);
                } catch (ActivityNotFoundException a) {
                   a.printStackTrace();
                }

但是代码不起作用它给出了异常

But code not worksit gives exception as

设备不支持语音转文字

有什么方法可以使用android东西或任何需要在Raspberry Pi上安装的包或apk来支持Raspberry Pi的语音到文本以支持语音到文本.请帮忙

Is there any way to support speech to text for Raspberry Pi using android things or any package or apk need to install on Raspberry Pi to support Speech to text.Please help

推荐答案

离线语音识别器在 Android Things 上不起作用,但有一些基于云的方式可以将音频发送到服务器并取回用户转录,例如作为 Google Cloud Speech API.

The offline speech recognizer does not work on Android Things, but there are cloud-based ways where you send audio to a server and get back the user transcription, such as the Google Cloud Speech API.

如果您正在收听一组特定的意图,您可能需要查看 Dialogflow API,它在幕后使用 Google Cloud Speech 和自然语言处理.还有 Google Assistant SDK,可让您嵌入完整的 Google Assistant.

If you have a specific set of intents that you are listening to, you may want to check out the Dialogflow API, which uses Google Cloud Speech behind the scenes with natural language processing. There is also the Google Assistant SDK, which would let you embed the full Google Assistant.

这篇关于android things:使用语音在Raspberry Pi 3中使用android things发送文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 09:57