Struct symphonia_core::audio::AudioBuffer[][src]

pub struct AudioBuffer<S: Sample> { /* fields omitted */ }

AudioBuffer is a container for multi-channel planar audio sample data. An AudioBuffer is characterized by the duration (capacity), and audio specification (channels and sample rate). The capacity of an AudioBuffer is the maximum number of samples the buffer may store per channel. Manipulation of samples is accomplished through the Signal trait or direct buffer manipulation.

Implementations

impl<S: Sample> AudioBuffer<S>[src]

pub fn new(duration: Duration, spec: SignalSpec) -> Self[src]

Instantiate a new AudioBuffer using the specified signal specification and of the given duration.

pub fn unused() -> Self[src]

Instantiates an unused AudioBuffer. An unused AudioBuffer will not allocate any memory, has a sample rate of 0, and no audio channels.

pub fn is_unused(&self) -> bool[src]

Returns true if the AudioBuffer is unused.

pub fn spec(&self) -> &SignalSpec[src]

Gets the signal specification for the buffer.

pub fn capacity(&self) -> usize[src]

Gets the total capacity of the buffer. The capacity is the maximum number of frames a buffer can store.

pub fn planes(&self) -> AudioPlanes<'_, S>[src]

Gets immutable references to all audio planes (channels) within the audio buffer.

Note: This is not a cheap operation. It is advisable that this call is only used when operating on batches of frames. Generally speaking, it is almost always better to use chan() to selectively choose the plane to read.

pub fn planes_mut(&mut self) -> AudioPlanesMut<'_, S>[src]

Gets mutable references to all audio planes (channels) within the buffer.

Note: This is not a cheap operation. It is advisable that this call is only used when mutating batches of frames. Generally speaking, it is almost always better to use render(), fill(), chan_mut(), and chan_pair_mut() to mutate the buffer.

pub fn convert<T: Sample>(&self, dest: &mut AudioBuffer<T>) where
    S: IntoSample<T>, 
[src]

Converts the contents of an AudioBuffer into an equivalent destination AudioBuffer of a different type. If the types are the same then this is a copy operation.

pub fn make_equivalent<E: Sample>(&self) -> AudioBuffer<E>[src]

Makes an equivalent AudioBuffer of a different type.

Trait Implementations

impl AsAudioBufferRef for AudioBuffer<f32>[src]

impl AsAudioBufferRef for AudioBuffer<i32>[src]

impl<S: Clone + Sample> Clone for AudioBuffer<S>[src]

impl<S: Sample> Signal<S> for AudioBuffer<S>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for AudioBuffer<S> where
    S: RefUnwindSafe

impl<S> Send for AudioBuffer<S> where
    S: Send

impl<S> Sync for AudioBuffer<S> where
    S: Sync

impl<S> Unpin for AudioBuffer<S> where
    S: Unpin

impl<S> UnwindSafe for AudioBuffer<S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F, T> IntoSample<T> for F where
    T: FromSample<F>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.