We are developing a camera app for Android.
android.hardware.Camera#takePicture(Camera.ShutterCallback shutter, Camera.PictureCallback raw, Camera.PictureCallback jpeg)
was called to retrieve the captured data in callback, but somehow the shutter sound did not ring.
Are there any Camera parameters required to play the default shutter sound?
Supplement:
Just in case, we also verified that Camera#enableShutterSound(true);
was called and true
was returned before takePicture
.(As long as you read enableShutterSound(boolean enabled) API Doc, this should have been set to play the default shutter sound correctly.)
If you take a picture with the standard (?) camera app Instagram, the same sound is played for each model (so I guess that's the default shutter sound for each device).
PictureCallback
can be used to play sound on your own, but I don't feel like it because I want to avoid duplication.Just to be sure, before takePicture
, we also verified that Camera#enableShutterSound(true);
was called and true
was returned.(As long as you read enableShutterSound(boolean enabled) API Doc, this should have been set to play the default shutter sound correctly.)
When I take pictures with the standard (?) camera app Instagram, the same sound is played for each model (so I guess that's the default shutter sound for each device).
environment:
What I wrote on http://qiita.com/tao_s/items/13d809c12875a6a4b752 worked.
final Camera.ShutterCallback dummyCallback=new Camera.ShutterCallback(){
@Override public void onShutter(){}
};
camera.takePicture(dummyCallback, null, this);
This makes a sound, but it doesn't sound when dummyCallback is null.
© 2024 OneMinuteCode. All rights reserved.