Struct symphonia_core::audio::AudioBuffer [−][src]
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]
S: IntoSample<T>,
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]
fn as_audio_buffer_ref(&self) -> AudioBufferRef<'_>
[src]
impl AsAudioBufferRef for AudioBuffer<i32>
[src]
fn as_audio_buffer_ref(&self) -> AudioBufferRef<'_>
[src]
impl<S: Clone + Sample> Clone for AudioBuffer<S>
[src]
fn clone(&self) -> AudioBuffer<S>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S: Sample> Signal<S> for AudioBuffer<S>
[src]
fn clear(&mut self)
[src]
fn frames(&self) -> usize
[src]
fn chan(&self, channel: usize) -> &[S]
[src]
fn chan_mut(&mut self, channel: usize) -> &mut [S]
[src]
fn chan_pair_mut(&mut self, first: usize, second: usize) -> (&mut [S], &mut [S])
[src]
fn render_reserved(&mut self, n_frames: Option<usize>)
[src]
fn render<'a, F>(&'a mut self, n_frames: Option<usize>, render: F) -> Result<()> where
F: FnMut(&mut AudioPlanesMut<'a, S>, usize) -> Result<()>,
[src]
F: FnMut(&mut AudioPlanesMut<'a, S>, usize) -> Result<()>,
fn transform<F>(&mut self, f: F) where
F: Fn(S) -> S,
[src]
F: Fn(S) -> S,
fn fill<'a, F>(&'a mut self, fill: F) -> Result<()> where
F: FnMut(&mut AudioPlanesMut<'a, S>, usize) -> Result<()>,
[src]
F: FnMut(&mut AudioPlanesMut<'a, S>, usize) -> Result<()>,
Auto Trait Implementations
impl<S> RefUnwindSafe for AudioBuffer<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for AudioBuffer<S> where
S: Send,
S: Send,
impl<S> Sync for AudioBuffer<S> where
S: Sync,
S: Sync,
impl<S> Unpin for AudioBuffer<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for AudioBuffer<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<F, T> IntoSample<T> for F where
T: FromSample<F>,
[src]
T: FromSample<F>,
pub fn into_sample(Self) -> T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,