pub struct PCM(/* private fields */);
Expand description
snd_pcm_t wrapper - start here for audio playback and recording
Implementations§
source§impl PCM
impl PCM
sourcepub fn new(name: &str, dir: Direction, nonblock: bool) -> Result<PCM>
pub fn new(name: &str, dir: Direction, nonblock: bool) -> Result<PCM>
Wrapper around open that takes a &str instead of a &CStr
pub fn open(name: &CStr, dir: Direction, nonblock: bool) -> Result<PCM>
pub fn start(&self) -> Result<()>
pub fn drop(&self) -> Result<()>
pub fn pause(&self, pause: bool) -> Result<()>
pub fn resume(&self) -> Result<()>
pub fn drain(&self) -> Result<()>
pub fn prepare(&self) -> Result<()>
pub fn reset(&self) -> Result<()>
pub fn recover(&self, err: c_int, silent: bool) -> Result<()>
sourcepub fn try_recover(&self, err: Error, silent: bool) -> Result<()>
pub fn try_recover(&self, err: Error, silent: bool) -> Result<()>
Wrapper around snd_pcm_recover.
Returns Ok if the error was successfully recovered from, or the original error if the error was unhandled.
pub fn wait(&self, timeout_ms: Option<u32>) -> Result<bool>
pub fn state(&self) -> State
sourcepub fn state_raw(&self) -> c_int
pub fn state_raw(&self) -> c_int
Only used internally, and for debugging the alsa library. Please use the “state” function instead.
pub fn bytes_to_frames(&self, i: isize) -> Frames
pub fn frames_to_bytes(&self, i: Frames) -> isize
pub fn avail_update(&self) -> Result<Frames>
pub fn avail(&self) -> Result<Frames>
pub fn avail_delay(&self) -> Result<(Frames, Frames)>
pub fn delay(&self) -> Result<Frames>
pub fn status(&self) -> Result<Status>
pub fn io_i8(&self) -> Result<IO<'_, i8>>
pub fn io_u8(&self) -> Result<IO<'_, u8>>
pub fn io_i16(&self) -> Result<IO<'_, i16>>
pub fn io_u16(&self) -> Result<IO<'_, u16>>
pub fn io_i32(&self) -> Result<IO<'_, i32>>
pub fn io_u32(&self) -> Result<IO<'_, u32>>
pub fn io_f32(&self) -> Result<IO<'_, f32>>
pub fn io_f64(&self) -> Result<IO<'_, f64>>
pub fn io_checked<S: IoFormat>(&self) -> Result<IO<'_, S>>
pub fn io(&self) -> IO<'_, u8> ⓘ
👎Deprecated: renamed to io_bytes
pub fn io_bytes(&self) -> IO<'_, u8> ⓘ
sourcepub fn direct_mmap_capture<S>(&self) -> Result<MmapCapture<S>>
pub fn direct_mmap_capture<S>(&self) -> Result<MmapCapture<S>>
Read buffers by talking to the kernel directly, bypassing alsa-lib.
sourcepub fn direct_mmap_playback<S>(&self) -> Result<MmapPlayback<S>>
pub fn direct_mmap_playback<S>(&self) -> Result<MmapPlayback<S>>
Write buffers by talking to the kernel directly, bypassing alsa-lib.
sourcepub fn hw_params(&self, h: &HwParams<'_>) -> Result<()>
pub fn hw_params(&self, h: &HwParams<'_>) -> Result<()>
Sets hw parameters. Note: No IO object can exist for this PCM when hw parameters are set.
sourcepub fn hw_params_current(&self) -> Result<HwParams<'_>>
pub fn hw_params_current(&self) -> Result<HwParams<'_>>
Retreive current PCM hardware configuration.
pub fn sw_params(&self, h: &SwParams<'_>) -> Result<()>
pub fn sw_params_current(&self) -> Result<SwParams<'_>>
sourcepub fn get_params(&self) -> Result<(u64, u64)>
pub fn get_params(&self) -> Result<(u64, u64)>
Wraps snd_pcm_get_params
, returns (buffer_size, period_size)
.
pub fn info(&self) -> Result<Info>
pub fn dump(&self, o: &mut Output) -> Result<()>
pub fn dump_hw_setup(&self, o: &mut Output) -> Result<()>
pub fn dump_sw_setup(&self, o: &mut Output) -> Result<()>
pub fn query_chmaps(&self) -> ChmapsQuery ⓘ
pub fn set_chmap(&self, c: &Chmap) -> Result<()>
pub fn get_chmap(&self) -> Result<Chmap>
pub fn link(&self, other: &PCM) -> Result<()>
pub fn unlink(&self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
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