是什么在较低水平AudioManager的流类型之间的区别? [英] What is the difference between AudioManager's stream types at low level?

查看:207
本文介绍了是什么在较低水平AudioManager的流类型之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有在 AudioManager 几个流类型。他们怎么会在较低水平有什么不同?难道是那个例如使用AudioManager.STREAM_MUSIC块输入麦克风流?还是其他什么东西?

There are several stream types in AudioManager. How did they differ at low level? Could it be that usage of e.g. AudioManager.STREAM_MUSIC blocks input microphone stream? Or something else?

推荐答案

其中最显著的区别是一个音量控制。

由于文件说,我们可以设置音量大小或调节音量每个流分别。

我们可以控制音频焦点访谈,让其他应用程序停止播放或降低体积,所以我们可以在一个特定的流显然播放声音,或者声音会不会阻止其它高优先级的声音就像手机响,导航语音反馈或类似的东西。

One most significant difference is a volume control.
As the document says, we can set a volume level or adjust a volume for each streams respectively.
And we can control "Audio Focus" that let other apps stop playback or lower the volumes so we can play a sound clearly on a specific stream, or the sound will not block the other high-prioritized sound like phone ring, navigation voice feedback or something like that.

使用多个应用程序可能播放音频它来想想他们应如何相互作用是非常重要的。为了避免每一个音乐应用程序在同一时间玩,Android使用音频设备适度持有音频重点应播放音频的音频仅回放应用。

With multiple apps potentially playing audio it's important to think about how they should interact. To avoid every music app playing at the same time, Android uses audio focus to moderate audio playback—only apps that hold the audio focus should play audio.

其他未提及的一点是它的音频设备会产生声音。

使用STREAM_MUSIC声音将通过连接到电话一个音频设备(手机喇叭,耳机,蓝牙音箱或别的东西)生产。

使用STREAM_RING声音将通过连接到电话的所有音频设备来制造。
这种行为可能会有所不同对每个设备。

Other unmentioned thing is which audio device will produce a sound.
Using STREAM_MUSIC the sound will be produced through one audio device(phone speaker, earphone, bluetooth speaker or something else) connected to the phone.
Using STREAM_RING the sound will be produced through all audio device connected to the phone. This behaviour might be differed for each devices.

这篇关于是什么在较低水平AudioManager的流类型之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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