Struct symphonia_core::audio::SampleBuffer[][src]

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

A SampleBuffer, is a sample oriented buffer. It is agnostic to the ordering/layout of samples within the buffer. SampleBuffer is mean’t for safely importing and exporting sample data to and from Symphonia using the sample’s in-memory data-type.

Implementations

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

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

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

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

Gets the number of written samples.

pub fn samples(&self) -> &[S][src]

Gets an immutable slice of all written samples.

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

Gets the maximum number of samples the SampleBuffer may store.

pub fn copy_planar_ref(&mut self, src: AudioBufferRef<'_>) where
    S: ConvertibleSample
[src]

Copies all audio data from the source AudioBufferRef in planar channel order into the SampleBuffer. The two buffers must be equivalent.

pub fn copy_planar_typed<F>(&mut self, src: &AudioBuffer<F>) where
    F: Sample + IntoSample<S>, 
[src]

Copies all audio data from a source AudioBuffer into the SampleBuffer in planar channel order. The two buffers must be equivalent.

pub fn copy_interleaved_ref(&mut self, src: AudioBufferRef<'_>) where
    S: ConvertibleSample
[src]

Copies all audio data from the source AudioBufferRef in interleaved channel order into the SampleBuffer. The two buffers must be equivalent.

pub fn copy_interleaved_typed<F>(&mut self, src: &AudioBuffer<F>) where
    F: Sample + IntoSample<S>, 
[src]

Copies all audio samples from a source AudioBuffer into the SampleBuffer in interleaved channel order. The two buffers must be equivalent.

Auto Trait Implementations

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

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

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

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

impl<S> UnwindSafe for SampleBuffer<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, 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.