开始
通过申请临时DUCK焦点可以压低其他在播放的音源,如源码中的注释,不会暂停其他在播放的音源,而是降低输出,在车载情景下,一般在地图导航或者语音播报的情景下会申请这个焦点。
// AudioManager.java
/**
* Used to indicate a temporary request of audio focus, anticipated to last a short
* amount of time, and where it is acceptable for other audio applications to keep playing
* after having lowered their output level (also referred to as "ducking").
* Examples of temporary changes are the playback of driving directions where playback of music
* in the background is acceptable.
* @see OnAudioFocusChangeListener#onAudioFocusChange(int)
* @see #requestAudioFocus(OnAudioFocusChangeListener, int, int)
*/
public static final int AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK

最低0.47元/天 解锁文章
2443

被折叠的 条评论
为什么被折叠?



