AUGraph reconfiguration in response to route change
AUGraph reconfiguration in response to route change
- Subject: AUGraph reconfiguration in response to route change
- From: Bartosz Nowotny <email@hidden>
- Date: Mon, 09 Jul 2018 21:32:21 +0200
Hello,
I am trying to programmatically reconfigure AUGraph at runtime, in response
to a route change.
My set up consists of a couple of AUMIDISynth nodes connected to a multi
channel mixer node which in turn is connected to RemoteIO node. This set up
works fine and I am able to produce audio by sending MIDI note on/off
events.
I want to avoid audio data resampling at any point in the graph. I can
start with a properly set up AUGraph that has all audio units use the same
sample rate (starting from midi synths, through mixer to remote IO). Route
changes (e.g. plugging in headphones) can change the output sample rate and
thus introduce resampling and other side effects.
To respond to a route change I set up a property listener for StreamFormat
on my IO unit. When the stream format changes, I call a method that
reconfigures the AUGraph in the following manner:
1. Stop the AUGraph
2. Uninitialize the AUGraph
3. Clear all graph connections
4. Set mixer output sample rate (propagates to IO input sample rate)
5. Set synth output sample rates (propagates to mixer input sample rates)
6. Connect synth nodes to mixer node
7. Connect mixer node to IO node
8. Update, Initialize and Start the AUGraph
None of the above operations returns an error result.
The issue occurs when I send some note on/off events - the app crashes.
What am I missing?
Regards,
Bartosz Nowotny
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden