简体   繁体   English

iOS:MPVolumeView中缺少音频路由/源

[英]iOS: Missing audio routes/sources in MPVolumeView

I work on an audio app (using audio units). 我在音频应用程序上工作(使用音频单元)。
One of the requirements is to be able to change the audio route from the UI (Earpiece, Speaker, Connected Bluetooth device etc.). 要求之一是能够从UI(听筒,扬声器,连接的蓝牙设备等)更改音频路由。
I use the MPVolumeView for this. 我为此使用MPVolumeView。

Recently I have a bug with the list of routes that are displayed in the action sheet that is opened when tapping the route button in the volume view. 最近,我在操作列表中发现了一个路由列表,该列表在点击音量视图中的“路由”按钮时打开了一个错误。
I think that the problem appears only in iOS6, but not sure about that. 我认为问题仅出现在iOS6中,但对此不确定。
The result is random: 结果是随机的:

  • sometimes it displays only iPhone 有时只显示iPhone
  • sometimes it displays iPhone twice instead of iPhone and Speaker (in this case usually the icon near both 'iPHone' buttons is like it is a speaker - TV icon) 有时它会显示两次iPhone,而不是iPhone和Speaker(在这种情况下,通常两个“ iPHone”按钮旁边的图标就像是扬声器-TV图标)
  • sometimes it works good 有时候效果很好
  • the Bluetooth is always displayed good 蓝牙始终显示良好

Some additional info: 一些其他信息:
The volume view is initiated only in Play&Record audio category. 只能在“播放和录制”音频类别中启动音量视图。
The volume view is initiated and added to the screen only after the user taps a corresponding button on the screen. 仅在用户点击屏幕上的相应按钮后,才会启动音量视图并将其添加到屏幕。 This button becomes available only after the category is switched to Play&Record (it is not immediate, so I set a listener to the route transitions and enable the button only after the route is REALLY changed). 仅在将类别切换到“播放和记录”后,此按钮才可用(它不是立即的,因此我为路由转换设置了侦听器,并且仅在路由真正更改后才启用该按钮)。

Screenshots: 屏幕截图: 在此处输入图片说明

在此处输入图片说明

If anyone has experienced this problem then please share a solution. 如果有人遇到此问题,请分享解决方案。

Thank you. 谢谢。

I've seen this in the multitasking tray's route selection UI on my iPhone 4S and 5 running 6.0. 我已经在运行6.0的iPhone 4S和5上的多任务托盘的路线选择UI中看到了这一点。 I suspect it's an iOS bug. 我怀疑这是一个iOS错误。

I have the same issue. 我有同样的问题。 What I've noticed is that it is related to the media currently being played. 我注意到的是,它与当前正在播放的媒体有关。 If it is not compatible with the Airplay / media device, then it does not appear in the list. 如果它与Airplay /媒体设备不兼容,则它不会出现在列表中。 For example, I want to play audio to a Bluetooth HFP device, which only supports 8Khz Audio. 例如,我想向仅支持8Khz音频的Bluetooth HFP设备播放音频。 I've seen an app which modifies the audio to match the device, but don't know how they do that programmatically. 我见过一个可以修改音频以匹配设备的应用程序,但不知道它们如何以编程方式进行操作。

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

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