[−][src]Struct quad_snd::snd::SoundDriver
This is the sound API that allows you to send events to your generator.
Implementations
impl<T: Send + 'static> SoundDriver<T>
[src]
pub fn get_error(&self) -> SoundError
[src]
After calling SoundDriver::new
, you can call this function to see if the audio initialization was a success.
pub fn new(generator: Box<dyn SoundGenerator<T>>) -> Self
[src]
Initialize the sound device and provide the generator to the driver.
pub fn send_event(&mut self, event: T)
[src]
Send an event to the generator
pub fn frame(&mut self)
[src]
This function should be called every frame. It's only needed on web target to fill the output sound buffer.
pub fn start(&mut self)
[src]
This will call the generator init function.
On native target, it starts the sound thread and the audio loop.
On web target, only the SoundDriver::frame
function produces sound.
Auto Trait Implementations
impl<T> !RefUnwindSafe for SoundDriver<T>
[src]
impl<T> Send for SoundDriver<T>
[src]
impl<T> !Sync for SoundDriver<T>
[src]
impl<T> Unpin for SoundDriver<T>
[src]
impl<T> !UnwindSafe for SoundDriver<T>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,