Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing output format of AVAudioNode

I'm trying to change the output format of a AVAudioMixerNode so that it outputs mono audio at a lower samplerate instead of the default format. Do I have to subclass the AVAudioMixerNode class and override the outputFormatForBus function to do that, or is there some other way?

like image 348
rodskagg Avatar asked Nov 27 '25 06:11

rodskagg


1 Answers

Check out the docs for AVAudioEngine for this method:

- (void)connect:(AVAudioNode *)node1 
             to:(AVAudioNode *)node2
         format:(AVAudioFormat *)format

Note the format parameter:

If not NULL, the format of the source audio node’s output bus is set to this AVAudioFormat object. In all cases, the format of the destination audio node’s input bus is set to match that of the source audio node’s output bus.

Specify the mono, lower-sample-rate AVAudioFormat whenever the AVAudioMixerNode output bus gets connected.

like image 192
Mark Avatar answered Nov 28 '25 20:11

Mark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!