Questions tagged «voice»

16
android mediaRecorder.setAudioSource失败
我有android G1固件1.6,我正在尝试使用以下代码记录来自应用程序的语音。 MediaRecorder记录器=新的MediaRecorder(); records.setAudioSource(MediaRecorder.AudioSource.MIC); records.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); records.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); records.setOutputFile(PATH_NAME); records.prepare(); records.start(); 我的manifest.xml具有: <uses-permission android:name =“ android.permission.RECORD_AUDIO” /> 我有: 09-23 14:41:05.531:错误/ AndroidRuntime(1718):未捕获的处理程序:由于未捕获的异常而导致线程主退出 09-23 14:41:05.551:错误/ AndroidRuntime(1718):java.lang.RuntimeException:setAudioSource失败。 09-23 14:41:05.551:错误/ AndroidRuntime(1718):位于android.media.MediaRecorder.setAudioSource(本机方法) 如何正确录制语音?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.