我可以同时运行 Android MediaRecorder 类的两个实例吗?例如
public MediaRecorder mrec1 ;
public MediaRecorder mrec2 ;
mrec1.setCamera(mCamera);
mrec1.setPreviewDisplay(surfaceHolder.getSurface());
mrec1.setVideoSource(MediaRecorder.VideoSource.CAMERA)
.
.
.
.
mrec2.setAudioSource(MediaRecorder.AudioSource.MIC);
mrec2.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mrec2.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
.
.
.
.
mrec1.prepare();
mrec2.prepare();
mrec1.start();
mrec2.start();
调用第二个 start() 时出现此错误我只想知道是因为已经调用了启动过程还是存在其他问题。第二个媒体记录器实例也被初始化并在单独的线程中使用。
04-22 11:08:45.869: E/MediaRecorder(7742): start failed: -2147483648
04-22 11:08:45.869: W/dalvikvm(7742): threadid=9: thread exiting with uncaught exception (group=0x40018578)
04-22 11:08:45.869: E/AndroidRuntime(7742): FATAL EXCEPTION: Thread-10
04-22 11:08:45.869: E/AndroidRuntime(7742): java.lang.RuntimeException: start failed.