Skip to content

Commit

Permalink
move shutter sound to right location
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianocca committed Mar 14, 2020
1 parent 4c75744 commit 1f89548
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,6 @@ public void onImageAvailable(ImageReader reader) {
if (image.getFormat() == ImageFormat.JPEG) {
// @TODO: implement deviceOrientation
mCallback.onPictureTaken(data, 0);
if (mPlaySoundOnCapture) {
MediaActionSound sound = new MediaActionSound();
sound.play(MediaActionSound.SHUTTER_CLICK);
}
} else {
mCallback.onFramePreview(data, image.getWidth(), image.getHeight(), mDisplayOrientation);
}
Expand Down Expand Up @@ -1302,6 +1298,10 @@ public void onCaptureCompleted(@NonNull CameraCaptureSession session,
&& !mCaptureCallback.getOptions().getBoolean("pauseAfterCapture")) {
unlockFocus();
}
if (mPlaySoundOnCapture) {
MediaActionSound sound = new MediaActionSound();
sound.play(MediaActionSound.SHUTTER_CLICK);
}
}
}, null);
} catch (CameraAccessException e) {
Expand Down

0 comments on commit 1f89548

Please sign in to comment.