INNER CODE UNIT · Rust
Some
shawnscode/crayon · modules/audio/src/mixer/mod.rs:66
if let Some(clip) = self.clips.read().unwrap().resource(params.clip).cloned() {
let handle = self.sources.write().unwrap().create();
let cmd = Command::CreateSource(handle, params, clip);
self.tx.write().unwrap().push(cmd);
Ok(handle)
} else {
bail!("The AudioClip {:?} is not available.", params.clip);
}
}
#[inline]
pub fn set_listener(&self, position: Vector3<f32>) {
let cmd = Command::SetListener(position);
self.tx.write().unwrap().push(cmd);
}
#[inline]
pub fn delete_source(&self, handle: AudioSourceHandle) {