Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 31
Registered: ‎08-26-2011
My Device: Torch 9810
My Carrier: AT&T

Turn off camera snap shot shutter sound

[ Edited ]

I have been trying to disable the camera shutter sound whn calling  VideoControl.getSnapshot().

 

The first time I tried to use the CameraControl.enbableShutterFeedback  method.

 

private CameraControl _cameraoptions;

_cameraoptions = (CameraControl) _camera.getControl("javax.microedition.amms.control.camera.CameraControl");


if (_cameraoptions != null) {
    _cameraoptions.enableShutterFeedback(false);
}
	    	        		 

 

This throws the following MediaException: Setting the shutter feedback is not possible.

 

Next I tried to mute the phone volume.

 

_audioVol = Audio.getVolume();
muteThread();
rawImage = _cameracontrol.getSnapshot(null);
unMuteThread(_audioVol);
_camera.stop();




private void muteThread() {
Thread t = new Thread(new Runnable() {
	public void run() {
		try {
			int i = 0;
			while (i < 50) {
				Audio.setVolume(0);
				System.out.println("\n\n >>>>> Volume set to 0. <<<< \n\n");
				try {
					Thread.sleep(50);
				} catch (InterruptedException e) {						
				}
				i++;
			}
			System.out.println("\n\n >>>>> End of Mute Thread. <<<< \n\n");
		} catch (Exception e) {
		}
	}
});
t.start();
}

public static void unMuteThread(final int vol) {
Thread t1 = new Thread(new Runnable() {
	public void run() {
		try {
			int vol2 = vol;
			int i = 0;
			if(vol2 == 0) {  //// vol2 < audioVol || 
				vol2 = _audioVol;
			}
			
			while (i < 50) {
				Audio.setVolume(vol2);
				try {
					Thread.sleep(50);
				} catch (InterruptedException e) {						
				}
				i++;
			}
			System.out.println("\n\n >>>>> End of UnMute Thread. <<<< \n\n");
		} catch (Exception e) {
		}
	}
});
t1.start();
}

 

I can see that the volume is being lowered but the shutter sound still occurs.  I have another app installed on the phone  that silences the shutter sound so there must be way.

 

Any help would be greatly appreciated.

 

 

 

 

 

Highlighted
Contributor
Posts: 31
Registered: ‎08-26-2011
My Device: Torch 9810
My Carrier: AT&T

Re: Turn off camera snap shot shutter sound

[ Edited ]

Here is the console listing from the debug session during the snapShot

 

 CAM:User Id:18
[182.804] CAM: getLastAsyncApiResult: Success
[182.804] CamController.OnCameraApplyConfigComplete : ApiResult : status=0; state=5; handle =6076131; opCode=8[182.804] ; userId=18
[183.078] CAM:User Id:18
[183.078] CAM: getLastAsyncApiResult: Success
[183.078] CamController.onCameraLockSettingsComplete : ApiResult : status=0; state=8; handle =6076131; opCode=[183.078] 15; userId=18
[185.062]
[185.062]
[185.062]  >>>>> Volume set to 0. <<<<
[185.062]
[185.062]
[185.062] CamTakePic img buf=5243008
[185.062] CamTakePic thumb buf=614400
[185.062] VM:EVTOv=1280,w=82
[185.07] CAM:User Id:18
[185.07] CAM: getLastAsyncApiResult: Success
[185.07] CamController.onCameraTakePictureComplete : ApiResult : status=0; state=6; handle =6076131; opCode=1[185.07] 7; userId=18
[185.07] AR: add source AUDIO_SOURCE_CAMERA_SHUTTER_ALERT
[185.07] AR: setAudioMode 0
[185.07] CAM: in getPicture
[185.07] CAM: in getPicture pdata=64800000, length=63181
[185.07] CAM: in getPicture, calling getJpegPicture
[185.07] CAM: in getJpegPicture, calling writeExif_rawjpeg_native
[185.07] Exif: done header
[185.078] Exif: done alloc
[185.078] Exif: write image 63179
[185.078] Exif: write image
[185.078] VM:EVTOv=1280,w=82
[185.078] CAM:User Id:18
[185.078] CAM: getLastAsyncApiResult: Success
[185.078] CamController.onCameraUnlockSettingsComplete : ApiResult : status=0; state=6; handle =6076131; opCod[185.078] e=16; userId=18
[185.093] CamControllerSmiley FrustratedtartVF
[185.109] CamControllerSmiley FrustratedtopVF current state=2561; queuing command
[185.117] SyncDecSmiley FrustratedtrImagejpg (0,0)640x480->(0,0)640x480
[185.14] SyncDecSmiley Very Happyone