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 more