Struct web_audio_api::node::PeriodicWave [−][src]
pub struct PeriodicWave { /* fields omitted */ }
Expand description
PeriodicWave
is a setup struct required to build
custom periodic waveform oscillator type.
Implementations
Returns a PeriodicWave
Arguments
real
- The real parameter represents an array of cosine terms of Fourrier series.imag
- The imag parameter represents an array of sine terms of Fourrier series.constraints
- The constraints parameter specifies the normalization mode of thePeriodicWave
Panics
Will panic if:
real
is defined and its length is less than 2imag
is defined and its length is less than 2real
andimag
are defined and theirs lengths are not equalPeriodicWave
is more than 8192 components
Example
use web_audio_api::context::{AudioContext, AsBaseAudioContext};
use web_audio_api::node::{PeriodicWave, PeriodicWaveOptions};
let context = AudioContext::new(None);
let options = PeriodicWaveOptions {
real: Some(vec![0.,1.,1.]),
imag: Some(vec![0.,0.,0.]),
disable_normalization: Some(false),
};
let periodic_wave = PeriodicWave::new(&context, Some(options));
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for PeriodicWave
impl Send for PeriodicWave
impl Sync for PeriodicWave
impl Unpin for PeriodicWave
impl UnwindSafe for PeriodicWave
Blanket Implementations
Mutably borrows from an owned value. Read more