2010-08-20 208 views

回答

0

您可以嘗試Android中提供的MediaRecorder類。它有選項來啓動和停止錄音

MediaRecorder recorder = new MediaRecorder(); 
recorder.setAudioSource(MediaRecorder.AudioSource.MIC); 
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); 
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); 
recorder.setOutputFile(PATH_NAME); 
recorder.prepare(); 
recorder.start(); // Recording is now started 
... 
recorder.stop(); 
recorder.reset(); // You can reuse the object by going back to setAudioSource() step 
recorder.release(); // Now the object cannot be reused 

https://developer.android.com/reference/android/media/MediaRecorder.html

+0

這個我知道。如何暫停? – user413881 2010-08-20 13:11:44

+0

據我所知,我們沒有MediaRecorder類的暫停功能。您只能停止並啓動它 – DeRagan 2010-08-20 13:49:27