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?
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 thisAVAudioFormatobject. 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With