How can I play the camera sound of a specific device when shooting?

Taking a picture on Android is pretty trivial:

camera.takePicture(null, null, mPicture);

      

My only concern is that there is no audible or visual indication.

Making a visual shutter animation on my layout sounds tricky, but I think I can handle it, but I'd really like to reproduce the original Android camera sound.

Since this sound can be specific to different manufacturers, I'm just wondering if it was a sound that we could easily use in an application.

Thanks for any help

Edit:

I found this snippet, but I believe there is a better way to achieve it:

        // Play the Shutter Sound
        AudioManager meng = (AudioManager) FullscreenActivity.this.getSystemService(
                Context.AUDIO_SERVICE);
        int volume = meng.getStreamVolume(AudioManager.STREAM_NOTIFICATION);


        if (volume != 0) {
            if (_shootMP == null)
                _shootMP = MediaPlayer
                        .create(FullscreenActivity.this,
                                Uri.parse("file:///system/media/audio/ui/camera_click.ogg"));
            if (_shootMP != null)
                _shootMP.start();
        }

      

Source: Alex Cohn

+3
android audio camera


source to share


No one has answered this question yet

See similar questions:

25
How to play native camera sound on Android

or similar:

eleven
Play camera audio only once for multiple images using AVFoundation OR Simple mute / mute
7
Android notification to play sound only
five
Android WebRTC audio volume
3
Mute MediaRecorder by default in camcorder applications
2
How to play synthesized sounds on Android?
1
Android emulator sound not working on specific computer
1
Android sound release issue
0
Set AudioStreamType for audio file played from Resource (raw folder)
0
Resize iPhone app without changing volume (Japan app)
0
Play sound along with camera shutter sound



All Articles
Loading...
X
Show
Funny
Dev
Pics