安卓mediaRecorder.setAudioSource失败mediaRecorder、setAudioSource

2023-09-04 06:11:03 作者:過期少女

我的Andr​​oid G1固件1.6,我想从与后续的code中的应用程序录制声音。

I have android G1 firmware 1.6, I am trying to record voice from the app with the follow code.


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();  

我的manifest.xml有:

my manifest.xml has:


<uses-permission android:name="android.permission.RECORD_AUDIO" />

我:


09-23 14:41:05.531: ERROR/AndroidRuntime(1718): Uncaught handler: thread main exiting due to uncaught exception
09-23 14:41:05.551: ERROR/AndroidRuntime(1718): java.lang.RuntimeException: setAudioSource failed.
09-23 14:41:05.551: ERROR/AndroidRuntime(1718):     at android.media.MediaRecorder.setAudioSource(Native Method)

我怎么录制的声音是否正常?

how do I record voice properly?

推荐答案

我发现这一点:的 HTTP://$c$c.google.com/p/android/issues/detail ID = 4075