问题
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 works it gives exception as
device does not support Speech to text
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
回答1:
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.
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.
来源:https://stackoverflow.com/questions/49166326/android-thingsuse-speech-to-text-in-raspberry-pi-3-using-android-things