/// ReadAt reads a chunk of the audio data stream and fill it to given buffer, at specified offset.
/// It returns size of data filled to the buffer and any write error encountered.
ReadAt reads a chunk of the audio data stream and fill it to given buffer, at specified offset.
It returns size of data filled to the buffer and any write error encountered.
ReadAt reads a chunk of the audio data stream and fill it to given buffer at specified offset . It returns size of data filled to the buffer and any write error encountered .
pub fn read_at(&self, buffer: &mut [u8], offset: u32) -> 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_from_position(
                self.handle.inner(),
                c_buffer,
                buffer.len() as u32,
                offset,
                &mut filled_size,
            );
            convert_err(ret, "AudioDataStream.read_at error")?;
            Ok(filled_size)
        }
    }
pub fn read_at ( & self , buffer : & mut [ u8 ] , offset : u32 ) -> 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_from_position ( self . handle . inner ( ) , c_buffer , buffer . len ( ) as u32 , offset , & mut filled_size , ) ; convert_err ( ret , " " ) ? ; Ok ( filled_size ) } }
ReadAt reads a chunk of the audio data stream and fill it to given buffer, at specified offset.
ReadAt reads a chunk of the audio data stream and fill it to given buffer at specified offset .
&self
buffer
&mut [u8]
offset
u32