【问题标题】:Check if the camera shutter sound is on or off in the settings Android在Android设置中检查相机快门声音是打开还是关闭
【发布时间】:2014-04-16 07:15:24
【问题描述】:

我正在使用自定义相机应用程序,如果它在设备上打开,我希望相机启用快门声音,否则将其关闭,所以是否有默认方法可以检查,或者我可以得到找到相机的设置信息。

我试过这段代码,但听起来是检查设备声音。

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

    if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
        Toast.makeText(MainActivity.this, "Normal", Toast.LENGTH_SHORT)
                .show();
    }

【问题讨论】:

    标签: android camera shutter


    【解决方案1】:
    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

    【讨论】:

    • 谢谢,但是如何获取相机的id,如果我可以打开或关闭它,这个方法会返回,但是如何知道它是打开还是关闭?
    猜你喜欢
    • 1970-01-01
    • 2013-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-09
    • 2011-10-20
    • 2013-03-11
    • 1970-01-01
    相关资源
    最近更新 更多