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§
Sourcefn play(&self) -> Result<(), AudioError>
fn play(&self) -> Result<(), AudioError>
Starts the device.
Sourcefn pause(&self) -> Result<(), AudioError>
fn pause(&self) -> Result<(), AudioError>
Stops the device.
Sourcefn set_volume(&self, volume: f32)
fn set_volume(&self, volume: f32)
Sets the input volume of the device.
Sourcefn sample_receiver(&mut self) -> Option<Receiver<Vec<u8>>>
fn sample_receiver(&mut self) -> Option<Receiver<Vec<u8>>>
Returns a receiver to this device’s values.
Sourcefn num_channels(&self) -> usize
fn num_channels(&self) -> usize
The amount of channels this device has.