Has anyone disabled sound in either Intent or MediaRecorder when record video in Google Glass?
I have removed permissions from AndroidManifest and I am not setting the audio source in MediaRecorder but I still record audio.
I am using XE22.
private boolean prepareVideoRecorder(){
if (mCamera != null){
mCamera.release(); // release the camera for other applications
}
mCamera = getCameraInstance();
if (mCamera == null) return false;
mrec = new MediaRecorder();
mCamera.unlock();
mrec.setCamera(mCamera);
//mrec.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
CamcorderProfile profile = getValidCamcorderProfile();
mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mrec.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mrec.setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight);
mrec.setVideoEncodingBitRate(profile.videoBitRate);
mrec.setVideoEncoder(profile.videoCodec);
mrec.setPreviewDisplay(mPreviewHolder.getSurface());
mOutputFile = getOutputMediaFile(MEDIA_TYPE_VIDEO);
mrec.setOutputFile(mOutputFile.toString());
try {
mrec.prepare();
}
catch (Exception e) {
Log.e(TAG, e.getMessage());
return false;
}
return true;
}
private CamcorderProfile getValidCamcorderProfile(){
CamcorderProfile profile;
if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_TIME_LAPSE_720P)){
profile = CamcorderProfile.get(CamcorderProfile.QUALITY_TIME_LAPSE_720P);
return profile;
}
if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_720P))
profile = CamcorderProfile.get(CamcorderProfile.QUALITY_720P);
else
profile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);
return profile;
}
The code is taken from the book Beginning Google Glass Development. Any Ideas??