[−][src]Struct waver::Wave
A structure that represent a sinusoidal wave.
The default value for a wave values is 0.0 except for the amplitude weight which is 1.0 (100% of available amplitude).
Fields
sample_rate: f32
The sampling rate of this wave.
frequency: f32
The frequency of this wave.
phase: f32
The phase of this wave.
amplitude: f32
The amplitude as a percentage [0.0 - 1.0].
Methods
impl Wave
[src]
ⓘImportant traits for WaveIterator<'a>pub fn iter(&self) -> WaveIterator
[src]
ⓘImportant traits for WaveIterator<'a>
An infinite iterator for the Wave structure.
The iterator will produce an infinite number of wave samples at the specified sampling rate and frequency.
Examples
use std::vec::Vec; use waver::Wave; let wave = Wave { sample_rate: 10000.0, frequency: 2000.0, ..Default::default() }; let res: Vec<f32> = wave.iter().take(10).collect();
Trait Implementations
impl Display for Wave
[src]
impl Debug for Wave
[src]
impl PartialEq<Wave> for Wave
[src]
impl<'a> IntoIterator for &'a Wave
[src]
type Item = f32
The type of the elements being iterated over.
type IntoIter = WaveIterator<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl Copy for Wave
[src]
impl Clone for Wave
[src]
fn clone(&self) -> Wave
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Wave
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,