简体   繁体   中英

Disable microphone when recording a video

I try to:

audioManager.setMicrophoneMute(true);
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0);

and it doesn't help!! (please help to find a solution)

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();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM