pub fn read(&self, buffer: &mut [u8]) -> Result<u32> {
        unsafe {
            #[allow(clippy::len_zero)]
            if buffer.len() == 0 {
                let rootc = ErrorRootCause::ApiError(0x005);
                return Err(Error::new(Error::api_error_desc(&rootc).unwrap(), rootc));
            }
            let mut filled_size: u32 = MaybeUninit::uninit().assume_init();
            // let c_buffer: *mut u8 = buffer as *const _ as *mut u8;
            let c_buffer = buffer.as_mut_ptr();
            let ret = audio_data_stream_read(
                self.handle.inner(),
                c_buffer,
                buffer.len() as u32,
                &mut filled_size,
            );
            convert_err(ret, "AudioDataStream.read error")?;
            Ok(filled_size)
        }
    }
/// Read reads a chunk of the audio data stream and fill it to given buffer.
/// It returns size of data filled to the buffer and any write error encountered.
Read reads a chunk of the audio data stream and fill it to given buffer.
It returns size of data filled to the buffer and any write error encountered.
Read reads a chunk of the audio data stream and fill it to given buffer . It returns size of data filled to the buffer and any write error encountered .
pub fn read(&self, buffer: &mut [u8]) -> Result<u32> {
        unsafe {
            #[allow(clippy::len_zero)]
            if buffer.len() == 0 {
                let rootc = ErrorRootCause::ApiError(0x005);
                return Err(Error::new(Error::api_error_desc(&rootc).unwrap(), rootc));
            }
            let mut filled_size: u32 = MaybeUninit::uninit().assume_init();
            // let c_buffer: *mut u8 = buffer as *const _ as *mut u8;
            let c_buffer = buffer.as_mut_ptr();
            let ret = audio_data_stream_read(
                self.handle.inner(),
                c_buffer,
                buffer.len() as u32,
                &mut filled_size,
            );
            convert_err(ret, "AudioDataStream.read error")?;
            Ok(filled_size)
        }
    }
pub fn read ( & self , buffer : & mut [ u8 ] ) -> Result < u32 > { unsafe { # [ allow ( clippy len_zero ) ] if buffer . len ( ) == 0 { let rootc = ErrorRootCause :: ApiError ( 0x005 ) ; return Err ( Error :: new ( Error :: api_error_desc ( & rootc ) . unwrap ( ) , rootc ) ) ; } let mut filled_size : u32 = MaybeUninit :: uninit ( ) . assume_init ( ) ; // let c_buffer: *mut u8 = buffer as *const _ as *mut u8; let c_buffer = buffer . as_mut_ptr ( ) ; let ret = audio_data_stream_read ( self . handle . inner ( ) , c_buffer , buffer . len ( ) as u32 , & mut filled_size , ) ; convert_err ( ret , " " ) ? ; Ok ( filled_size ) } }
Read reads a chunk of the audio data stream and fill it to given buffer.
Read reads a chunk of the audio data stream and fill it to given buffer .
&self
buffer
&mut [u8]
&self
buffer
&mut [u8]