Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stop camera click sound programmatically in android

Tags:

android

I am using android's default camera to click images from within my app. I want to stop the click sound that it does on clicking an image. Is there a way to stop that click sound programtically?

Thanks.

like image 394
mudit Avatar asked Oct 20 '09 11:10

mudit


1 Answers

I was able to successfully use the trick to turn the volume down. I did this just before taking the picture:

    AudioManager mgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
    mgr.setStreamMute(AudioManager.STREAM_SYSTEM, true);

And this just after getting the first message back:

    AudioManager mgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
    mgr.setStreamMute(AudioManager.STREAM_SYSTEM, false);
like image 166
Joseph Jaquinta Avatar answered Sep 21 '22 18:09

Joseph Jaquinta