4

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

Bhagyashri
  • 182
  • 1
  • 15

1 Answers1

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.

Nick Felker
  • 11,536
  • 1
  • 21
  • 35
  • here means I have to create a audio file and send it to the Speech api ?what is the daily free limit to use that api – Bhagyashri Mar 08 '18 at 06:24
  • You'd have to check the specifics of each API. They may support streaming audio, but if you create a recording in memory you should be able to send the whole payload at one time. – Nick Felker Mar 08 '18 at 06:53
  • Is it ok to use Opensource library pocketphonics for speech to text in android things instead of using Google Cloud Speech API. – Bhagyashri Mar 09 '18 at 05:12
  • Sure, it's fine if it works. I'm not familiar with that library to say for sure. – Nick Felker Mar 09 '18 at 06:28