我在android中遇到媒体记录器问题。我正在录制与 LG P500 配合良好的音频,但相同的代码在三星 GT - S5360 上不起作用。我收到错误,因为启动失败 -22。
这是我正在使用的代码:
final MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(path);
try {
recorder.prepare();
recorder.start();
} catch (Exception e) { Log.d(TAG, "Exception : " + e); }
当调试在 logcat 中导致为 null 时。
请建议我一些解决方案。