开发者

Outputting sound using multiple audio routes at the same time in an iPhone App?

开发者 https://www.devze.com 2023-01-10 03:27 出处:网络
I\'m playing around with audio 开发者_开发问答routes in AVAudioSession at the moment and I\'m wondering whether it is possible to output sound to multiple audio routes at the same time i.e. a sound pl

I'm playing around with audio 开发者_开发问答routes in AVAudioSession at the moment and I'm wondering whether it is possible to output sound to multiple audio routes at the same time i.e. a sound playing from the speaker and a different sound playing in the headphones? Ideally I'd like to be able to play separate sounds via a dock connector (using a 3.5mm jack adapter) and the headphone jack at the same time so if someone could tell me whether or not this is actually possible that would be a great help.

Thanks


I don't think it was possible three years ago when you wrote this, but it is possible now to play one sound through the headphone jack and another through a USB audio interface connected to the dock connector. This WWDC presentation walks you through it and provides sample code.

I don't think it's possible to play separate sounds through the headphone jack and the speaker because the AVAudioSessionRouteDescription only shows one of these built-in output ports at a time. You'd have to add a second audio interface via USB, which adds a second output port to the AVAudioSessionRouteDescription. I'm testing with a Roland Duo-Capture mk2 right now and it's working.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号