iOS:MPVolumeView中缺少音频路由/源 [英] iOS: Missing audio routes/sources in MPVolumeView

查看:102
本文介绍了iOS:MPVolumeView中缺少音频路由/源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用音频应用程序(使用音频单元).
要求之一是能够从UI(听筒,扬声器,已连接的蓝牙设备等)更改音频路由.
我为此使用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.).
I use the MPVolumeView for this.

最近,我有一个错误,该错误涉及在操作表中显示的路由列表,该列表在点击音量视图中的路由"按钮时打开.
我认为问题仅出现在iOS6中,但对此不确定.
结果是随机的:

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.
The result is random:

  • 有时它仅显示iPhone
  • 有时它会显示两次iPhone,而不是iPhone和Speaker(在这种情况下,通常两个"iPHone"按钮旁边的图标就像是扬声器-TV图标)
  • 有时效果很好
  • 蓝牙始终显示良好

一些其他信息:
只能在播放和录制音频"类别中启动音量视图.
仅在用户点击屏幕上的相应按钮后,才会启动音量视图并将其添加到屏幕.仅在类别切换到播放和录制"后,此按钮才可用(它不是立即的,因此我为路由转换设置了侦听器,并且仅在路由真正更改后才启用该按钮).

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).

屏幕截图:

如果有人遇到此问题,请分享解决方案.

If anyone has experienced this problem then please share a solution.

谢谢.

推荐答案

我遇到了同样的问题.我注意到的是,它与当前正在播放的媒体有关.如果它与Airplay/媒体设备不兼容,则它不会出现在列表中.例如,我想向仅支持8Khz音频的Bluetooth HFP设备播放音频.我见过一个可以修改音频以匹配设备的应用程序,但不知道它们是如何以编程方式完成的.

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. For example, I want to play audio to a Bluetooth HFP device, which only supports 8Khz Audio. I've seen an app which modifies the audio to match the device, but don't know how they do that programmatically.

这篇关于iOS:MPVolumeView中缺少音频路由/源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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