SpeechRecognizer causes ANR… I need help with Android speech API
Make Sure to use the RECORD_AUDIO permission.
Make Sure to use the RECORD_AUDIO permission.
The API does not allow it, but see this blog post and its comments for a potential workaround. Also make sure that your file contains high quality audio (at least 16 bit and 16 kHz) to get a better transcription. See also: Voice recognition on android with recorded sound clip?
Here is the code using SpeechRecognizer class (sourced from here and here): import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.widget.Button; import android.widget.TextView; import java.util.ArrayList; import android.util.Log; public class VoiceRecognitionTest extends Activity implements OnClickListener { private TextView mText; private SpeechRecognizer sr; private static final String TAG … Read more
I think desktop recognition is starting because you are using a shared desktop recognizer. You should use an inproc recognizer for your application only. you do this by instantiating a SpeechRecognitionEngine() in your application. Since you are using the dictation grammar and the desktop windows recognizer, I believe it can be trained by the speaker … Read more
Perhaps you want to use the .net System.Speech namespace instead of SAPI? There is a very good article that was published a few years ago at http://msdn.microsoft.com/en-us/magazine/cc163663.aspx. It is probably the best introductory article I’ve found so far. It is a little out of date, but very helfpul. (The AppendResultKeyValue method was dropped after the … Read more
I’ll rehash and update an answer from Speech recognition in C or Java or PHP?. This is by no means comprehensive, but it might be a start for you From watching these questions for few months, I’ve seen most developer choices break down like this: Windows folks – use the System.Speech features of .Net or … Read more
OpenEars looks promising… http://www.politepix.com/openears/ Based on Pocket Sphinx.
@Kaarel’s answer is almost complete – the resulting audio is in intent.getData() and can be read using ContentResolver Unfortunately, the AMR file that is returned is low quality – I wasn’t able to find a way to get high quality recording. Any value I tried other than “audio/AMR” returned null in intent.getData(). If you find … Read more
Google did quietly enable offline recognition in that Search update, but there is (as yet) no API or additional parameters available within the SpeechRecognizer class. {See Edit at the bottom of this post} The functionality is available with no additional coding, however the user’s device will need to be configured correctly for it to begin … Read more