How to Use the Speechrecognizer API Directly for Speech Input

Using SpeechRecognizer API directly - onResults() keeps returning null

According to the documentation of the listener you need to request the results with SpeechRecognizer.RESULTS_RECOGNITION from the bundle given to onResults(). Have you tried that?

RecognizerIntent.EXTRA_RESULTS is to be used when using the RECOGNIZE_SPEECH intent.

How can I use speech recognition without the annoying dialog in android phones

Use the SpeechRecognizer interface. Your app needs to have the RECORD_AUDIO permission, and you can then create a SpeechRecognizer, give it a RecognitionListener and then call its startListening method. You will get callbacks to the listener when the speech recognizer is ready to begin listening for speech and as it receives speech and converts it to text.

Is there a way to use the Javascript SpeechRecognition API with an audio file?

The short answer is No.

The Web Speech Api Specification does not prohibit this (the browser could allow the end-user to choose a file to use as input), but the audio input stream is never provided to the calling javascript code (in the current draft version), so you don't have any way to read or change the audio that is input to the speech recognition service.

This specification was designed so that the javascript code will only have access to the result text coming from the speech recognition service.



Related Topics



Leave a reply



Submit