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>,
);
}