Struct dbsdk_rs::sounddriver::SoundDriver
source · [−]pub struct SoundDriver { /* private fields */ }
Implementations
sourceimpl SoundDriver
impl SoundDriver
sourcepub fn new(max_voices: usize) -> SoundDriver
pub fn new(max_voices: usize) -> SoundDriver
Construct a new instance of the SoundDriver
sourcepub fn set_listener(&mut self, position: Vector3, orientation: Quaternion)
pub fn set_listener(&mut self, position: Vector3, orientation: Quaternion)
Set the listener position & orientation
sourcepub fn play(
&mut self,
priority: u8,
sample: &Arc<AudioSample>,
looping: bool,
reverb: bool,
volume: f32,
pitch: f32,
pan: f32
) -> Weak<RwLock<SoundEmitter>>
pub fn play(
&mut self,
priority: u8,
sample: &Arc<AudioSample>,
looping: bool,
reverb: bool,
volume: f32,
pitch: f32,
pan: f32
) -> Weak<RwLock<SoundEmitter>>
Start playing a sound effect and return a handle to it
sourcepub fn play_3d(
&mut self,
priority: u8,
sample: &Arc<AudioSample>,
looping: bool,
reverb: bool,
volume: f32,
pitch: f32,
position: Vector3,
atten_type: AttenuationType,
atten_min_dist: f32,
atten_max_dist: f32,
atten_rolloff: f32
) -> Weak<RwLock<SoundEmitter>>
pub fn play_3d(
&mut self,
priority: u8,
sample: &Arc<AudioSample>,
looping: bool,
reverb: bool,
volume: f32,
pitch: f32,
position: Vector3,
atten_type: AttenuationType,
atten_min_dist: f32,
atten_max_dist: f32,
atten_rolloff: f32
) -> Weak<RwLock<SoundEmitter>>
Start playing a 3D sound effect and return a handle to it
sourcepub fn stop(&mut self, emitter_ref: Weak<RefCell<SoundEmitter>>)
pub fn stop(&mut self, emitter_ref: Weak<RefCell<SoundEmitter>>)
Stop the playing emitter
Auto Trait Implementations
impl RefUnwindSafe for SoundDriver
impl Send for SoundDriver
impl Sync for SoundDriver
impl Unpin for SoundDriver
impl UnwindSafe for SoundDriver
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more