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 the PeriodicWave
Panics

Will panic if:

  • real is defined and its length is less than 2
  • imag is defined and its length is less than 2
  • real and imag are defined and theirs lengths are not equal
  • PeriodicWave 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.