[][src]Struct miniaudio::SyncDecoder

pub struct SyncDecoder { /* fields omitted */ }

A decoder with synchronization. This will use a spinlock to synchronize access to the decoder on each function call. The decoder may have multiple readers or one writer. Cloning this decoder will simply return another reference to the same decoder.

Implementations

impl SyncDecoder[src]

pub fn from_file<P: AsRef<Path>>(
    file: P,
    config: Option<&DecoderConfig>
) -> Result<Self, Error>
[src]

Creates a SyncDecoder from a file. This will fail with an InvalidFile error if the path is not valid utf-8.

pub fn from_memory<M: Into<Vec<u8>>>(
    data: M,
    config: Option<&DecoderConfig>
) -> Result<Self, Error>
[src]

pub fn from_read<T: 'static + SeekRead>(
    reader: T,
    config: Option<&DecoderConfig>
) -> Result<Self, Error>
[src]

pub fn from_boxed_read(
    reader: Box<dyn SeekRead>,
    config: Option<&DecoderConfig>
) -> Result<Self, Error>
[src]

pub fn read_pcm_frames(&self, output: &mut FramesMut) -> u64[src]

This will block until the lock for the inner decoder is acquired before calling read_pcm_frames.

pub fn try_read_pcm_frames(&self, output: &mut FramesMut) -> u64[src]

This will immediately return with 0 if the inner decoder is currently locked, if it is not this will acquire the lock and return the number of frames written.

pub fn seek_to_pcm_frame(&self, frame_index: u64) -> Result<(), Error>[src]

pub fn length_in_pcm_frames(&self) -> u64[src]

pub fn output_format(&self) -> Format[src]

pub fn output_channels(&self) -> u32[src]

pub fn output_sample_rate(&self) -> u32[src]

pub fn write(&self) -> RwLockWriteGuard<RawDecoder>[src]

pub fn read(&self) -> RwLockReadGuard<RawDecoder>[src]

pub fn try_write(&self) -> Option<RwLockWriteGuard<RawDecoder>>[src]

pub fn try_read(&self) -> Option<RwLockReadGuard<RawDecoder>>[src]

Trait Implementations

impl Clone for SyncDecoder[src]

impl Drop for SyncDecoder[src]

impl Send for SyncDecoder[src]

impl Sync for SyncDecoder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.