Struct screech::Stream[][src]

pub struct Stream {
    pub samples: Vec<f32>,
    pub channels: usize,
}
Expand description

Struct representing a stream of audio data

Fields

samples: Vec<f32>

Vec containing all audio points, multiple channels are interleaved

channels: usize

amount of channels

Implementations

Create zero initialized (silent) stream

Create new stream based on provided samples

Returns the length of the stream

note this does not take into account the amount of channels

Get sample for provided position argument, errors when the index does not exist in the stream

Mix together multiple streams into the given stream

note the size of the stream is unchanged, if the other streams are shorter it inserts silence (0.0) if the other streams are longer the remaining points are ignored

note this is a naive mix, it does not take into account the channel size, it assumes you are mixing together channels of the same size

Amplify a stream by decibels

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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)

recently added

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.