Core Audio (Audio Units) audio session and MPVolumeView

I work on a VOIP app. I use Core Audio Audio Units for playing and recording audio. I need to be able to manipulate sound volume and output devices. I am trying to use MPVolumeView to set sound volume and choose output devices.

My problem is: When I start using(start playout and capture for RemoteIO Audio Unit) Audio Units it seems MPVolumeView no longer control volume of my session but instead it controls system wide sound preferences. At the same time hardware buttons control volume of sounds played by Audio Units. Also when I start using Audio Units MPVolumeView start showing button to change output devices but before that it doesn't.

It seems that MPVolumeView controls sound volume for some system wide audio session but when I start using Audio Units another app wide (or even Audio Unit wide) audio session is created and used to play sound.

So the question is how to make MPVolumeView control sound volume for my Core Audio audio session?

I would appreciate any hints on why this happens. I've spent almost all day googling and I see that some people have related problems but none got any hints :(. I can also post more details if needed.


Confirmed as a bug by Apple engineer.

In more details - MPVolumeView should be tied to a specific audio route (in more broad sense, like audio route + audio category + mode etc.), and it is for a couple of most common routes (eg headphones + play category + default mode) but not to all custom routes you can create.

So basically when one creates some custom route MPVolumeView still tries to control it's last (workable) or default route.

链接地址: http://www.djcxy.com/p/79028.html

上一篇: 不使用时禁用iOS音频会话?

下一篇: 核心音频(音频单元)音频会话和MPVolumeView