I'd like to replace the shutter sound (the sound the camera makes when snapping a photo) with something else in code. I was hoping it would be like ringtones or notifications, but I don't see anything anywhere other about it. I've seen code to silence the phone right before taking the pic, and unsilencing it right after, but I'd prefer to replace the sound with another mp3 or ogg.
Understand if you have a rooted phone, you can replace the file. This is not a solution for my app.
Just in my app. Idea would be to set it, then unset it. Funny how after you type something out, re-read it, it helps think of it from a different perspective. I've used the code below to shut down the audio service, and I play my sound right before. Works as a great workaround. Perhaps someday, we'll be able to set it.
AudioManager mgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
mgr.setStreamMute(AudioManager.STREAM_SYSTEM, true);
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…