AudioInputDevice

Trait AudioInputDevice 

Source
pub trait AudioInputDevice {
    // Required methods
    fn play(&self) -> Result<(), AudioError>;
    fn pause(&self) -> Result<(), AudioError>;
    fn set_volume(&self, volume: f32);
    fn sample_receiver(&mut self) -> Option<Receiver<Vec<u8>>>;
    fn num_channels(&self) -> usize;
}
Expand description

Something that can listen to audio and send it somewhere.

One sample is assumed to be an encoded opus frame. See opus::Encoder.

Required Methods§

Source

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

Starts the device.

Source

fn pause(&self) -> Result<(), AudioError>

Stops the device.

Source

fn set_volume(&self, volume: f32)

Sets the input volume of the device.

Source

fn sample_receiver(&mut self) -> Option<Receiver<Vec<u8>>>

Returns a receiver to this device’s values.

Source

fn num_channels(&self) -> usize

The amount of channels this device has.

Implementors§