Routing audio to a specific device output on OS X

I want to add a preview channel to the AV project so that the video or audio file can be played on the main output channel, but the user can view a separate audio or video file on another channel.

Naturally, the precondition is that the user has an audio device capable of several channels or a separate device for the main output than for preview. For example, the output may go to a USB audio device that provides balanced audio output, but previews can be done through a standard headphone jack.

I try my best to find the necessary documentation for listing the audio devices connected to the poppy, and then bind either AVAudioPlayer, or AVPlayer / AVPlayerLayer, or the base API.

Does anyone know where I should look?

Is this a case of finding audio devices, choosing the right one, and then using something like NSSound to install the device before I start playing the file? What happens to files that are already playing?

thanks

+6
source share
1 answer

Please note that AVAudioSession is iOS only.

0
source

Source: https://habr.com/ru/post/950607/


All Articles