简体   繁体   English

Android Camera2 API中的等效canDisableShutterSound方法

[英]Equivalent canDisableShutterSound method in Android Camera2 API

Is there an equivalent canDisableShutterSound method in the Camera2 API? Camera2 API中是否有等效的canDisableShutterSound方法?

I couldn't find any details about it, so I'm assuming the Camera2 API allows taking pictures without the shutter sound, but this is only my assumption because some countries enforce by law the shutter sound in smartphones, such as Japan, where the device default shutter sound is played at the time of picture taking regardless of whether the app plays another shutter sound or not. 我找不到任何详细信息,所以我假设Camera2 API允许在没有快门音的情况下拍照,但这只是我的假设,因为某些国家/地区会在智能手机(例如日本)中强制执行快门音不论应用程序是否播放其他快门声音,在拍照时都会播放设备默认的快门声音。 At least this is the case for the legacy Camera API. 至少旧版Camera API就是这种情况。

The use case is to be able to ignore the app custom shutter sound if detected that the device will be also play its own audio, which in the old camera API was resolved by using the canDisableShutterSound method. 如果检测到设备还将播放其自己的音频,则该用例将能够忽略应用程序自定义快门声音,在旧相机API中,这是通过使用canDisableShutterSound方法解决的。

Camera2 does not play any sounds automatically. Camera2不会自动播放任何声音。

Instead, the camera-using application is required to follow the expectations on shutter sound enforcement in whatever country it is available in. MediaActionSound can be used for this. 取而代之的是,使用摄像头的应用程序必须符合在任何可用国家/地区执行快门声音的要求。MediaActionSound可以用于此目的。

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

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