androidvoice-recognition

How to get the recorded voice in the form of a file recorded using ACTION_RECOGNIZE_SPEECH android


I'm using RecognizerIntent to record user voice. I'm using following code:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {

        ArrayList<String> matches = data.getStringArrayListExtra(
                RecognizerIntent.EXTRA_RESULTS);
        mList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
                matches));
    }

    super.onActivityResult(requestCode, resultCode, data);
}

Here I'm getting the recorded speech as string. I want to obtain the recorded voice file to store it on sdcard.

How should I get it?


Solution

  • I made this work using tutorial at http://www.ibm.com/developerworks/opensource/library/os-android-sensor/index.html.