我的目标是使用Android相机拍摄视频并录制 麦克风的声音。视频+录音机Android
我使用Google代码,但无法获得任何工作示例或代码。
我已经试过是
recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
CamcorderProfile cpHigh = CamcorderProfile
.get(CamcorderProfile.QUALITY_HIGH);
recorder.setProfile(cpHigh);
recorder.setOutputFile("/sdcard/videocapture_example.mp4");
recorder.setMaxDuration(50000); // 50 seconds
recorder.setMaxFileSize(5000000); // Approximately 5 megabytes
recorder.setVideoSize(320, 240);
recorder.setVideoFrameRate(15);
我得到一个RuntimeException
了java.lang.RuntimeException:setAudioSource失败。
以下行
recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
试图用更换
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
但这也不管用。
请张贴你得到了错误。 – 2011-11-16 12:30:12
检查代码之前,你是否试图在真实的设备上? –
@alextsc java.lang.RuntimeException:无法启动活动java.lang.RuntimeException:setAudioSource失败。 –