0

我正在尝试构建 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);

}
4

0 回答 0