Struct web_audio_api::PeriodicWaveOptions
source · [−]pub struct PeriodicWaveOptions {
pub real: Option<Vec<f32>>,
pub imag: Option<Vec<f32>>,
pub disable_normalization: bool,
}
Expand description
Options for constructing a PeriodicWave
Fields
real: Option<Vec<f32>>
The real parameter represents an array of cosine terms of Fourrier series.
The first element (index 0) represents the DC-offset. This offset has to be given but will not be taken into account to build the custom periodic waveform.
The following elements (index 1 and more) represent the fundamental and harmonics of the periodic waveform.
imag: Option<Vec<f32>>
The imag parameter represents an array of sine terms of Fourrier series.
The first element (index 0) will not be taken into account to build the custom periodic waveform.
The following elements (index 1 and more) represent the fundamental and harmonics of the periodic waveform.
disable_normalization: bool
By default PeriodicWave is build with normalization enabled (disable_normalization = false). In this case, a peak normalization is applied to the given custom periodic waveform.
If disable_normalization is enabled (disable_normalization = true), the normalization is defined by the periodic waveform characteristics (img, and real fields).
Trait Implementations
sourceimpl Clone for PeriodicWaveOptions
impl Clone for PeriodicWaveOptions
sourcefn clone(&self) -> PeriodicWaveOptions
fn clone(&self) -> PeriodicWaveOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PeriodicWaveOptions
impl Debug for PeriodicWaveOptions
sourceimpl Default for PeriodicWaveOptions
impl Default for PeriodicWaveOptions
sourcefn default() -> PeriodicWaveOptions
fn default() -> PeriodicWaveOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for PeriodicWaveOptions
impl Send for PeriodicWaveOptions
impl Sync for PeriodicWaveOptions
impl Unpin for PeriodicWaveOptions
impl UnwindSafe for PeriodicWaveOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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