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 Fourier 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 Fourier 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§
source§impl Clone for PeriodicWaveOptions
impl Clone for PeriodicWaveOptions
source§fn clone(&self) -> PeriodicWaveOptions
fn clone(&self) -> PeriodicWaveOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PeriodicWaveOptions
impl Debug for PeriodicWaveOptions
source§impl Default for PeriodicWaveOptions
impl Default for PeriodicWaveOptions
source§fn default() -> PeriodicWaveOptions
fn default() -> PeriodicWaveOptions
Auto Trait Implementations§
impl Freeze for PeriodicWaveOptions
impl RefUnwindSafe for PeriodicWaveOptions
impl Send for PeriodicWaveOptions
impl Sync for PeriodicWaveOptions
impl Unpin for PeriodicWaveOptions
impl UnwindSafe for PeriodicWaveOptions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)