2012-07-06 10 views
9

Talking Tomのような音声認識アプリを開発するには?
1.私の要求は、ボタン、タッチイベントのようなイベントなしで音声を認識する方法です。
2.すべての音声録音サンプルはスルーボタンを含みますが、私の要件は、それは自動的にトムのようないくつかの他の声で音声を変更したり、
3をオウムの声を停止し、私は再生ボタンのボタン話し言葉のような音声認識アプリを開発する方法

私の.java

File storageDir = new File(Environment.getExternalStorageDirectory(), "SRAVANTHI"); 
storageDir.mkdir(); 
Log.d(APP_TAG, "Storage directory set to " + storageDir); 
outfile = File.createTempFile("hascode", ".3gp", storageDir); 

// init recorder 
recorder.setAudioSource(MediaRecorder.AudioSource.MIC); 
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); 
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); 
recorder.setOutputFile(outfile.getAbsolutePath()); 

// init player 
player.setDataSource(outfile.getAbsolutePath()); 

try { 
    recorder.prepare(); 
    recorder.start(); 
    recording = true; 
} catch (IllegalStateException e) { 
    Log.w(APP_TAG, "Invalid recorder state .. reset/release should have been called"); 
} catch (IOException e) { 
    Log.w(APP_TAG, "Could not write to sd card"); 
} 

recorder.stop(); 

を介して行われている

try { 
    playing = true; 
    player.prepare(); 
    player.start(); 
} catch (IllegalStateException e) { 
    Log.w(APP_TAG, "illegal state .. player should be reset"); 
} catch (IOException e) { 
    Log.w(APP_TAG, "Could not write to sd card"); 
} 

答えて