Struct symphonia_core::audio::SampleBuffer
source · pub struct SampleBuffer<S: Sample> { /* private fields */ }
Expand description
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§
source§impl<S: Sample> SampleBuffer<S>
impl<S: Sample> SampleBuffer<S>
sourcepub fn new(duration: Duration, spec: SignalSpec) -> SampleBuffer<S>
pub fn new(duration: Duration, spec: SignalSpec) -> SampleBuffer<S>
Instantiate a new SampleBuffer
using the specified signal specification and of the given
duration.
sourcepub fn samples_mut(&mut self) -> &mut [S]
pub fn samples_mut(&mut self) -> &mut [S]
Gets a mutable slice of all written samples.
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
SampleBuffer
. 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
into the SampleBuffer
in planar
channel 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
SampleBuffer
. 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 samples from a source AudioBuffer
into the SampleBuffer
in interleaved
channel order. The two buffers must be equivalent.