簡體   English   中英

檢查Android設置中相機快門聲是否打開或關閉

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

我正在使用自定義攝像頭應用程序,我希望攝像頭在設備上打開快門聲時將其啟用,否則將其關閉,因此是否有默認方法將對其進行檢查,或者我可以獲取的設置信息相機找到那個。

我嘗試了此代碼,但聽起來是在設備聲音上進行檢查。

    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)
}

如何在Android手機上使相機快門聲音靜音

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM