[−][src]Struct sfxr::Generator
Sound effect generator
Generates sound effect data according to a Sample into a buffer. The data can be generated in
multiple chunks, as the generator maintains its state from one call to generate
to the next.
Fields
sample: Sample
Generator settings
volume: f32
Sound effect volume. Default is 0.2
.
Methods
impl Generator
[src]
pub fn new(s: Sample) -> Generator
[src]
Constructs a new Generator based on the provided Sample
pub fn generate(&mut self, buffer: &mut [f32])
[src]
Fills buffer
with sound effect data. Subsequent calls continue where the last left off.
Call reset
first to start generating from the beginning.
pub fn reset(&mut self)
[src]
Resets the generator to the beginning of the sound effect.
Auto Trait Implementations
impl Send for Generator
impl Sync for Generator
impl Unpin for Generator
impl UnwindSafe for Generator
impl RefUnwindSafe for Generator
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,