I wrote some code to play the shuttersound for Android using the camera2 API. The code is:
MediaActionSound mediaActionSound = new MediaActionSound();
mediaActionSound.play(MediaActionSound.SHUTTER_CLICK);
I've tested on more than ten devices. The problems are:
- The actually play a different sound that the built-in camera.
- Different devices actually play different sound. (It seems that the device manufacturer each has installed a different sound fine.)
There is some information about this file: /system/media/audio/ui/camera_click.ogg ... but I'm not sure if this is the sound file used. And if so, why do they all sound different and not the same as the built-in camera.
The solution I'm seeking:
Either:
Play exactly the same sound as with the built-in camera. How do I do this?
or
Install a custom sound file into my app and play this same sound across all devices. (However, this method is secondarily preferred because we have to find a custom sound file.)
Please advise.