Tuesday, August 9, 2011

[android-developers] capture audio from google recognizer intent

Hello,

I neet do capture the audio from google recognizer intent
Right now, I'm doing something like this:

Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, 
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,"stuff");
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, getLanguagePref());
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, R.string.prompt);
startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);

I figure there is no way to access the byte stream from this intent, so, I'm trying something like this:

      SpeechRecognizer speechRecognizer = SpeechRecognizer.createSpeechRecognizer(this);
speechRecognizer.setRecognitionListener(new RecognizerListener() { ... });

but I'm still havin some trouble, can anyone help me out here?
I need to store the data in the device and NOT send to google server;

/* I'm not using regular audio record because I need to know when the user is speeking to begin save and when the
user stoped, to stop save */

tks,
--
Dayvid Victor R. de Oliveira
10º Periodo de Engenharia da Computação - UFPE
Laboratório Itautec - CIn/UFPE

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment