INNER CODE UNIT · Rust
new
shawnscode/crayon · modules/audio/src/mixer/mod.rs:26
pub fn new(clips: Arc<RwLock<ResourcePool<AudioClipHandle, AudioClipLoader>>>) -> Result<Self> {
let tx = Arc::new(RwLock::new(Vec::new()));
#[cfg(not(target_arch = "wasm32"))]
cpal::run(tx.clone())?;
#[cfg(target_arch = "wasm32")]
webaudio::run(tx.clone())?;
Ok(Mixer {
sources: RwLock::new(HandlePool::new()),
tx: tx,
clips: clips,
})
}
pub fn headless(
clips: Arc<RwLock<ResourcePool<AudioClipHandle, AudioClipLoader>>>,