Replacing audio stream when switching devices
I’ve implemented a logic in the audio engine, that allows the Kadent DAW to switch the output device.
It was challenging because Mixer and MPSC consumers cannot be cloned. Finally I used Arc and Mutex in order to share the context with multiple threads.
let callback_ctx = Arc::new(Mutex::new(OutputCallbackContext {
mixer,
command_cons,
midi_cons,
vu_prod,
pending_project: pending_arc,
}));
I used try_lock instead of normal lock, which may block the thread, as you can see in the screenshot.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.