Struct audio_device::alsa::Configurator [−][src]
This is supported on crate feature
alsa
only.A simple Pcm stream configuration.
Examples
use audio_device::alsa; let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?; let config = pcm.configure::<f32>() .rate(48000) .channels(5) .install()?; dbg!(config);
Implementations
impl<'a, T> Configurator<'a, T> where
T: Sample,
[src]
T: Sample,
pub fn access(self, access: Access) -> Self
[src]
Configure the stream access to use.
Examples
use audio_device::alsa; let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?; let config = pcm.configure::<f32>() .access(alsa::Access::MmapInterleaved) .install()?; dbg!(config);
pub fn format(self, format: Format) -> Result<Self>
[src]
Configure the stream format to use.
This will check that the format is appropriate to use by the current sample. Inappropriate formats will be signalled with Error::FormatMismatch.
Examples
use audio_device::alsa; let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?; let config = pcm.configure::<f32>() .format(alsa::Format::FloatLE)? .install()?; dbg!(config);
pub fn latency(self, latency: Duration) -> Self
[src]
Configure the stream latency to use.
Will never accept a latency higher than 2**32
. Anything larger will be floored to it.
Examples
use audio_device::alsa; let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?; let config = pcm.configure::<f32>() .latency(std::time::Duration::from_micros(500)) .install()?; dbg!(config);
pub fn channels(self, channels: c_uint) -> Self
[src]
Configure the number of channels to use.
Examples
use audio_device::alsa; let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?; let config = pcm.configure::<f32>() .channels(5) .install()?; dbg!(config);
pub fn rate(self, rate: c_uint) -> Self
[src]
Configure the sample rate to use.
Examples
use audio_device::alsa; let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?; let config = pcm.configure::<f32>() .rate(48000) .install()?; dbg!(config);
pub fn install(self) -> Result<Config>
[src]
Install the current configuration and return the one which is used by the underlying PCM.
Examples
use audio_device::alsa; let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?; let config = pcm.configure::<f32>() .channels(2) .rate(48000) .install()?; dbg!(config);
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Configurator<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for Configurator<'a, T> where
T: Send,
T: Send,
impl<'a, T> !Sync for Configurator<'a, T>
impl<'a, T> Unpin for Configurator<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> !UnwindSafe for Configurator<'a, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,