#[non_exhaustive]pub struct AudioDecoded {
pub id: AudioId,
pub offset: usize,
pub chunk: IpcBytesCast<f32>,
pub is_full: bool,
}Expand description
Represents a partial or fully decoded audio.
See Event::AudioDecoded for more details.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: AudioIdThe audio track ID.
An AudioMetadata for this ID was already notified before this event.
offset: usizeOffset of the chunk on the track.
This is a count in samples before the first in this chunk, a sample is a sequence of channel_count.
To convert offset to bytes offset * channel_count * size_of::<f32>().
chunk: IpcBytesCast<f32>Interleaved f32 samples.
is_full: boolIf the chunk is actually the full decoded audio.
When this is true no more decode events for the id are send, (re)playing the audio
will read directly from the cache.
When this is false the chunk represent the last decoded chunk on demand because the audio is playing.
Depending on the request the audio may never be fully cached, always decoding again on replay.
Implementations§
Source§impl AudioDecoded
impl AudioDecoded
Sourcepub fn new(id: AudioId, chunk: IpcBytesCast<f32>) -> Self
pub fn new(id: AudioId, chunk: IpcBytesCast<f32>) -> Self
New.
Trait Implementations§
Source§impl Clone for AudioDecoded
impl Clone for AudioDecoded
Source§fn clone(&self) -> AudioDecoded
fn clone(&self) -> AudioDecoded
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AudioDecoded
impl Debug for AudioDecoded
Source§impl Default for AudioDecoded
Invalid initial value.
impl Default for AudioDecoded
Invalid initial value.
Source§impl<'de> Deserialize<'de> for AudioDecoded
impl<'de> Deserialize<'de> for AudioDecoded
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for AudioDecoded
impl PartialEq for AudioDecoded
Source§impl Serialize for AudioDecoded
impl Serialize for AudioDecoded
impl StructuralPartialEq for AudioDecoded
Auto Trait Implementations§
impl Freeze for AudioDecoded
impl RefUnwindSafe for AudioDecoded
impl Send for AudioDecoded
impl Sync for AudioDecoded
impl Unpin for AudioDecoded
impl UnwindSafe for AudioDecoded
Blanket Implementations§
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more