Struct web_audio_api::node::PeriodicWaveOptions [−][src]
pub struct PeriodicWaveOptions {
pub real: Option<Vec<f32>>,
pub imag: Option<Vec<f32>>,
pub disable_normalization: Option<bool>,
}
Expand description
Options for constructing a periodic wave
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: Option<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).