Post

Replies

Boosts

Views

Activity

Reply to Handling AVAudioEngine Configuration Change
@milesegan Were there any memory management issues switching from AVAudioPlayerNode to AVAudioSourceNode? I'm using the player node now and am having issues when the audio engine goes through a configuration change. When this happens I stop the engine, remove the player node(s), re-attach and re-connect the player nodes, and then restart the engine. I wrote this code before realizing source nodes were a thing. I'm hoping that using a source mode makes things simpler and require less dynamic coordination. My thinking is that I can have the requisite number of source nodes connected to a mixer and just leave that configuration around for the duration of my app. Then, when one of my two or three dedicated inputs comes online, I can feed buffers into the source nodes and not worry about adding and removing player nodes. From your experience, does this sound like it would work? Would you be willing to share some code showing how you configure your engine with the source node?
Topic: Media Technologies SubTopic: Audio Tags:
Oct ’25
Reply to downsampling in AVAudioEngine graph
From what I have observed, downsampling or upsampling is automatic, if you use a mixer. Specifically what I observed was that one end of the mixer is attached to the input node, which was running at 44.1KHz. The other end of the mixer was connected to an AVAudioPlayerNode running at 48KHz. I could hear the network transmitted audio coming out of the speaker. This confused me at first until I looked at the specific documentation for AVAudioMixer: "The mixer accepts input at any sample rate and efficiently combines sample rate conversions. It also accepts any channel count and correctly upmixes or downmixes to the output channel count."
Topic: Media Technologies SubTopic: Audio Tags:
Oct ’25
Reply to How to safely switch between mic configurations on iOS?
The call to setVoiceProcessingEnabled(isEnabled: Bool) is synchronous, it triggers a configuration change in the engine, so you must ensure that you access formats from input and output node after changing the voice processing enabled state to ensure you’re configuring your graph with the correct formats. Additionally there is some sample code available here as part of the AVEchoTouch project - https://developer.apple.com/documentation/avfaudio/using-voice-processing?language=objc
Topic: Media Technologies SubTopic: Audio Tags:
3w