简体   繁体   English

检查Android设置中相机快门声是否打开或关闭

[英]Check if the camera shutter sound is on or off in the settings Android

I'm using a custom camera application , i want the camera to enable the shutter sound if it was on on the device and turn it off otherwise , so is there a default method which will check that , or can i get the settings information of the camera to find that . 我正在使用自定义摄像头应用程序,我希望摄像头在设备上打开快门声时将其启用,否则将其关闭,因此是否有默认方法将对其进行检查,或者我可以获取的设置信息相机找到那个。

I tried this code , but it sounds that is check on the device sound. 我尝试了此代码,但听起来是在设备声音上进行检查。

    AudioManager audioService = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

    if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
        Toast.makeText(MainActivity.this, "Normal", Toast.LENGTH_SHORT)
                .show();
    }
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(id, info);
if (info.canDisableShutterSound) {
    mCamera.enableShutterSound(false)
}

How to mute camera shutter sound on android phone 如何在Android手机上使相机快门声音静音

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM