如何从语音识别API中保存音频?

时间:2013-04-12 21:59:07

标签: android speech-recognition voice-recognition speech-to-text

我试图构建Android移动应用程序以保存我在mp3文件中所说的,使用Android语音识别API(我不使用媒体播放器记录功能) 这是我的代码,我该怎么办?

    public class Voice extends Activity implements OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {

    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);


    setContentView(R.layout.voice);

    Intent i=new Intent (RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
                 i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    i.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speak up son!");
    i.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS,1);
    startActivityForResult(i,check);

}

0 个答案:

没有答案