pub struct RawSampleBuffer<S: Sample + RawSample> { /* private fields */ }
Expand description

A RawSampleBuffer, is a byte-oriented sample buffer. All samples copied to this buffer are converted into their packed data-type and stored as a stream of bytes. RawSampleBuffer is mean’t for safely importing and exporting sample data to and from Symphonia as raw bytes.

Implementations§

source§

impl<S: Sample + RawSample> RawSampleBuffer<S>

source

pub fn new(duration: Duration, spec: SignalSpec) -> RawSampleBuffer<S>

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

source

pub fn len(&self) -> usize

Gets the number of written samples.

source

pub fn is_empty(&self) -> bool

Returns true if the buffer contains no written samples.

source

pub fn capacity(&self) -> usize

Gets the maximum number of samples the RawSampleBuffer may store.

source

pub fn clear(&mut self)

Clears all written samples.

source

pub fn as_bytes(&self) -> &[u8]

Gets an immutable slice to the bytes of the sample’s written in the RawSampleBuffer.

source

pub fn copy_planar_ref(&mut self, src: AudioBufferRef<'_>)

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

source

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

Copies all audio data from a source AudioBuffer that is of a different sample format type than that of the RawSampleBuffer in planar channel order. The two buffers must be equivalent.

source

pub fn copy_planar(&mut self, src: &AudioBuffer<S>)

Copies all audio data from the source AudioBuffer to the RawSampleBuffer in planar order. The two buffers must be equivalent.

source

pub fn copy_interleaved_ref(&mut self, src: AudioBufferRef<'_>)

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

source

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

Copies all audio data from a source AudioBuffer that is of a different sample format type than that of the RawSampleBuffer in interleaved channel order. The two buffers must be equivalent.

source

pub fn copy_interleaved(&mut self, src: &AudioBuffer<S>)

Copies all audio data from the source AudioBuffer to the RawSampleBuffer in interleaved channel order. The two buffers must be equivalent.

Auto Trait Implementations§

§

impl<S> RefUnwindSafe for RawSampleBuffer<S>

§

impl<S> Send for RawSampleBuffer<S>
where S: Send, <S as RawSample>::RawType: Send,

§

impl<S> Sync for RawSampleBuffer<S>
where S: Sync, <S as RawSample>::RawType: Sync,

§

impl<S> Unpin for RawSampleBuffer<S>
where S: Unpin,

§

impl<S> UnwindSafe for RawSampleBuffer<S>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

source§

fn into_sample(self) -> T

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.