pub struct AudioConfig {
pub device_name: Option<String>,
pub sample_rate: u32,
pub channels: u16,
pub buffer_size: u32,
pub output: bool,
pub backend: AudioBackend,
}Expand description
Configuration for audio I/O
Fields§
§device_name: Option<String>Device name (None for default)
sample_rate: u32Sample rate
channels: u16Number of channels
buffer_size: u32Buffer size
output: boolUse output device (false for input)
backend: AudioBackendAudio backend to use
Implementations§
Source§impl AudioConfig
impl AudioConfig
Sourcepub fn new_output() -> Self
pub fn new_output() -> Self
Create new audio configuration for output
Sourcepub fn sample_rate(self, rate: u32) -> Self
pub fn sample_rate(self, rate: u32) -> Self
Set sample rate
Sourcepub fn buffer_size(self, size: u32) -> Self
pub fn buffer_size(self, size: u32) -> Self
Set buffer size
Sourcepub fn backend(self, backend: AudioBackend) -> Self
pub fn backend(self, backend: AudioBackend) -> Self
Set audio backend
Trait Implementations§
Source§impl Clone for AudioConfig
impl Clone for AudioConfig
Source§fn clone(&self) -> AudioConfig
fn clone(&self) -> AudioConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AudioConfig
impl Debug for AudioConfig
Source§impl Default for AudioConfig
impl Default for AudioConfig
Source§impl<'de> Deserialize<'de> for AudioConfig
impl<'de> Deserialize<'de> for AudioConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AudioConfig
impl RefUnwindSafe for AudioConfig
impl Send for AudioConfig
impl Sync for AudioConfig
impl Unpin for AudioConfig
impl UnwindSafe for AudioConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more