camera - Android: takePicture() not making sound -
i using takepicture() method camera class. takes picture , makes no sound! client wants default click sound android makes.
i have seen other threads , seems problem in disabling sound, not opposite! why app not making click sound??
i had problem. solved using following code: following used call takepicture:
clickbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(final view view) { mcamera.takepicture(shuttercallback, null, onpictaken); } }); now shutteercallback:
private final shuttercallback shuttercallback = new shuttercallback() { public void onshutter() { audiomanager mgr = (audiomanager) getsystemservice(context.audio_service); mgr.playsoundeffect(audiomanager.flag_play_sound); } }; now whatever after taking picture camera:
/** * called after taking picture camera. */ final transient private picturecallback onpictaken = new picturecallback() { /** * after taking picture, onpicturetaken() called image * saved. * */ @override public void onpicturetaken(final byte[] data, final camera camera) { } this play sound on clicking capture button.
thank :)
Comments
Post a Comment