AudioFileReadBytes

Function AudioFileReadBytes 

Source
pub unsafe extern "C-unwind" fn AudioFileReadBytes(
    in_audio_file: AudioFileID,
    in_use_cache: bool,
    in_starting_byte: i64,
    io_num_bytes: NonNull<u32>,
    out_buffer: NonNull<c_void>,
) -> i32
Available on crate feature AudioFile only.
Expand description

Read bytes of audio data from the audio file.

Returns kAudioFileEndOfFileError when read encounters end of file.

Parameter inAudioFile: an AudioFileID.

Parameter inUseCache: true if it is desired to cache the data upon read, else false

Parameter inStartingByte: the byte offset of the audio data desired to be returned

Parameter ioNumBytes: on input, the number of bytes to read, on output, the number of bytes actually read.

Parameter outBuffer: outBuffer should be a void * to user allocated memory large enough for the requested bytes.

Returns: returns noErr if successful.

ยงSafety

  • in_audio_file must be a valid pointer.
  • io_num_bytes must be a valid pointer.
  • out_buffer must be a valid pointer.