Struct symphonia_core::audio::RawSampleBuffer
source · 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>
impl<S: Sample + RawSample> RawSampleBuffer<S>
sourcepub fn new(duration: Duration, spec: SignalSpec) -> RawSampleBuffer<S>
pub fn new(duration: Duration, spec: SignalSpec) -> RawSampleBuffer<S>
Instantiate a new RawSampleBuffer
using the specified signal specification and of the given
duration.
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Gets the maximum number of samples the RawSampleBuffer
may store.
sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Gets an immutable slice to the bytes of the sample’s written in the RawSampleBuffer
.
sourcepub fn copy_planar_ref(&mut self, src: AudioBufferRef<'_>)where
S: ConvertibleSample,
pub fn copy_planar_ref(&mut self, src: AudioBufferRef<'_>)where
S: ConvertibleSample,
Copies all audio data from the source AudioBufferRef
in planar channel order into the
RawSampleBuffer
. The two buffers must be equivalent.
sourcepub fn copy_planar_typed<F>(&mut self, src: &AudioBuffer<F>)where
F: Sample + IntoSample<S>,
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.
sourcepub fn copy_planar(&mut self, src: &AudioBuffer<S>)
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.
sourcepub fn copy_interleaved_ref(&mut self, src: AudioBufferRef<'_>)where
S: ConvertibleSample,
pub fn copy_interleaved_ref(&mut self, src: AudioBufferRef<'_>)where
S: ConvertibleSample,
Copies all audio data from the source AudioBufferRef
in interleaved channel order into the
RawSampleBuffer
. The two buffers must be equivalent.
sourcepub fn copy_interleaved_typed<F>(&mut self, src: &AudioBuffer<F>)where
F: Sample + IntoSample<S>,
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.
sourcepub fn copy_interleaved(&mut self, src: &AudioBuffer<S>)
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.