Trait servo_media_audio::sink::AudioSink

source ·
pub trait AudioSink: Send {
    // Required methods
    fn init(
        &self,
        sample_rate: f32,
        render_thread_channel: Sender<AudioRenderThreadMsg>,
    ) -> Result<(), AudioSinkError>;
    fn init_stream(
        &self,
        channels: u8,
        sample_rate: f32,
        socket: Box<dyn MediaSocket>,
    ) -> Result<(), AudioSinkError>;
    fn play(&self) -> Result<(), AudioSinkError>;
    fn stop(&self) -> Result<(), AudioSinkError>;
    fn has_enough_data(&self) -> bool;
    fn push_data(&self, chunk: Chunk) -> Result<(), AudioSinkError>;
    fn set_eos_callback(
        &self,
        callback: Box<dyn Fn(Box<dyn AsRef<[f32]>>) + Send + Sync + 'static>,
    );
}

Required Methods§

source

fn init( &self, sample_rate: f32, render_thread_channel: Sender<AudioRenderThreadMsg>, ) -> Result<(), AudioSinkError>

source

fn init_stream( &self, channels: u8, sample_rate: f32, socket: Box<dyn MediaSocket>, ) -> Result<(), AudioSinkError>

source

fn play(&self) -> Result<(), AudioSinkError>

source

fn stop(&self) -> Result<(), AudioSinkError>

source

fn has_enough_data(&self) -> bool

source

fn push_data(&self, chunk: Chunk) -> Result<(), AudioSinkError>

source

fn set_eos_callback( &self, callback: Box<dyn Fn(Box<dyn AsRef<[f32]>>) + Send + Sync + 'static>, )

Implementors§