Struct wasapi::AudioClient[][src]

pub struct AudioClient { /* fields omitted */ }

Implementations

impl AudioClient[src]

pub fn get_mixformat(&self) -> Result<WaveFormat, Box<dyn Error>>[src]

pub fn is_supported(
    &self,
    wave_fmt: &WaveFormat,
    sharemode: &ShareMode
) -> Result<Option<WaveFormat>, Box<dyn Error>>
[src]

Check if a format is supported. If it’s directly supported, this returns Ok(None). If not, but a similar format is, then the supported format is returned as Ok(Some(WaveFormat)).

pub fn get_periods(&self) -> Result<(i64, i64), Box<dyn Error>>[src]

Get default and minimum periods in 100-nanosecond units

pub fn initialize_client(
    &mut self,
    wavefmt: &WaveFormat,
    period: i64,
    direction: &Direction,
    sharemode: &ShareMode,
    convert: bool
) -> Result<(), Box<dyn Error>>
[src]

Initialize an IAudioClient for the given direction, sharemode and format. Setting convert to true enables automatic samplerate and format conversion, meaning that almost any format will be accepted.

pub fn set_get_eventhandle(&self) -> Result<Handle, Box<dyn Error>>[src]

Create an return an event handle for an IAudioClient

pub fn get_bufferframecount(&self) -> Result<u32, Box<dyn Error>>[src]

Get buffer size in frames

pub fn get_current_padding(&self) -> Result<u32, Box<dyn Error>>[src]

Get current padding in frames. This represents the number of frames currently in the buffer, for both capture and render devices.

pub fn get_available_space_in_frames(&self) -> Result<u32, Box<dyn Error>>[src]

Get buffer size minus padding in frames. Use this to find out how much free space is available in the buffer.

pub fn start_stream(&self) -> Result<(), Box<dyn Error>>[src]

Start the stream on an IAudioClient

pub fn stop_stream(&self) -> Result<(), Box<dyn Error>>[src]

Stop the stream on an IAudioClient

pub fn reset_stream(&self) -> Result<(), Box<dyn Error>>[src]

Reset the stream on an IAudioClient

pub fn get_audiorenderclient(&self) -> Result<AudioRenderClient, Box<dyn Error>>[src]

Get a rendering (playback) client

pub fn get_audiocaptureclient(
    &self
) -> Result<AudioCaptureClient, Box<dyn Error>>
[src]

Get a capture client

Auto Trait Implementations

impl RefUnwindSafe for AudioClient

impl !Send for AudioClient

impl !Sync for AudioClient

impl Unpin for AudioClient

impl UnwindSafe for AudioClient

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.