什么是机器人类AudioManager音频重点是什么? [英] What is audio focus in Android class AudioManager?

查看:108
本文介绍了什么是机器人类AudioManager音频重点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AudioManager 类有一个方法 abandonAudioFocus()键,另一种方法 requestAudioFocus() 。我不知道什么是音频重点是什么?如果一个 AudioManager 对象获取将音频或丢失的音频重心会发生什么?

The AudioManager class has a method abandonAudioFocus() and another method requestAudioFocus(). I wonder what is audio focus? And what happens if an AudioManager object gets the audio focus or lost the audio focus?

感谢您!

推荐答案

它使用时的扬声器,以prevent打齐头并进或被覆盖优先做的事情。如果您 requestAudioFocus(),你宣称要控制。然后,您可以用 onAudioFocusChange(INT focusChange)听来看看别的尝试播放声音。你可以有力地失去焦点(如在通话期间),但是你以后可以得到它。你应该 abandonAudioFocus()时,你就完蛋了。

It has to do with priority when using the speakers, to prevent playing many things at once or being overridden. If you requestAudioFocus(), you're declaring that you want control. You can then listen with onAudioFocusChange(int focusChange) to see if anything else tries to play a sound. You may forcefully lose focus (like during a phone call) but then you can gain it later. You should abandonAudioFocus() when you're finished.

这篇关于什么是机器人类AudioManager音频重点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆