pub(crate) unsafe fn readi<T>(
    pcm: *mut c_void,
    buffer: *mut T,
    length: u16,
) -> Result<usize, isize> {
    ALSA.with(|alsa| {
        let alsa = if let Some(alsa) = alsa {
            alsa
        } else {
            return Ok(0);
        };
        let ret = (alsa.snd_pcm_readi)(pcm, buffer.cast(), length.into());
        Ok(ret.try_into().map_err(|_| -> isize { ret as isize })?)
    })
}
/// Read microphone input into an audio frame buffer.
///
/// Marked unsafe because pcm must be configured to handle interleaved frames
/// the size of `F` to prevent undefined behavior.
Read microphone input into an audio frame buffer.
Marked unsafe because pcm must be configured to handle interleaved frames
the size of `F` to prevent undefined behavior.
Read microphone input into an audio frame buffer . Marked unsafe because pcm must be configured to handle interleaved frames the size of ` F ` to prevent undefined behavior .
pub(crate) unsafe fn readi<T>(
    pcm: *mut c_void,
    buffer: *mut T,
    length: u16,
) -> Result<usize, isize> {
    ALSA.with(|alsa| {
        let alsa = if let Some(alsa) = alsa {
            alsa
        } else {
            return Ok(0);
        };
        let ret = (alsa.snd_pcm_readi)(pcm, buffer.cast(), length.into());
        Ok(ret.try_into().map_err(|_| -> isize { ret as isize })?)
    })
}
pub ( crate ) unsafe fn readi < T > ( pcm : * mut c_void , buffer : * mut T , length : u16 , ) -> Result < usize , isize > { ALSA . with ( | alsa | { let alsa = if let Some ( alsa ) = alsa { alsa } else { return Ok ( 0 ) ; } ; let ret = ( alsa . snd_pcm_readi ) ( pcm , buffer . cast ( ) , length . into ( ) ) ; Ok ( ret . try_into ( ) . map_err ( | _ | -> isize { ret as isize } ) ? ) } ) }
Read microphone input into an audio frame buffer.
Read microphone input into an audio frame buffer .
pcm
*mut c_void
buffer
*mut T
length
u16
pcm
*mut c_void
buffer
*mut T
length
u16