录制视频时禁用麦克风
Disable microphone when recording a video
我尝试:
audioManager.setMicrophoneMute(true);
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0);
而且没有用!! (请帮忙寻找解决方案)
mrec = new MediaRecorder();
mCamera.unlock();
mrec.setCamera(mCamera);
mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA);
CamcorderProfile profile = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);
mrec.setOutputFormat(profile.fileFormat);
mrec.setVideoFrameRate(profile.videoFrameRate);
mrec.setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight);
mrec.setVideoEncodingBitRate(profile.videoBitRate);
mrec.setVideoEncoder(profile.videoCodec);
mrec.setPreviewDisplay(surfaceHolder.getSurface());
mrec.setOutputFile("/sdcard/sample.3gp");
mrec.prepare();
mrec.start();
我尝试:
audioManager.setMicrophoneMute(true);
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0);
而且没有用!! (请帮忙寻找解决方案)
mrec = new MediaRecorder();
mCamera.unlock();
mrec.setCamera(mCamera);
mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA);
CamcorderProfile profile = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);
mrec.setOutputFormat(profile.fileFormat);
mrec.setVideoFrameRate(profile.videoFrameRate);
mrec.setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight);
mrec.setVideoEncodingBitRate(profile.videoBitRate);
mrec.setVideoEncoder(profile.videoCodec);
mrec.setPreviewDisplay(surfaceHolder.getSurface());
mrec.setOutputFile("/sdcard/sample.3gp");
mrec.prepare();
mrec.start();