AudioFileComponentReadPackets

Function AudioFileComponentReadPackets 

Source
pub unsafe extern "C-unwind" fn AudioFileComponentReadPackets(
    in_component: AudioFileComponent,
    in_use_cache: bool,
    out_num_bytes: NonNull<u32>,
    out_packet_descriptions: *mut AudioStreamPacketDescription,
    in_starting_packet: i64,
    io_num_packets: NonNull<u32>,
    out_buffer: NonNull<c_void>,
) -> i32
Available on crate features AudioComponent and objc2-core-audio-types only.
Expand description

implements AudioFileReadPackets.

For all uncompressed formats, packets == frames. ioNumPackets less than requested indicates end of file.

Parameter inComponent: an AudioFileComponent

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

Parameter outNumBytes: on output, the number of bytes actually returned

Parameter outPacketDescriptions: on output, an array of packet descriptions describing the packets being returned. NULL may be passed for this parameter. Nothing will be returned for linear pcm data.

Parameter inStartingPacket: the packet index of the first packet desired to be returned

Parameter ioNumPackets: on input, the number of packets to read, on output, the number of packets actually read.

Parameter outBuffer: outBuffer should be a pointer to user allocated memory of size: number of packets requested times file’s maximum (or upper bound on) packet size.

Returns: returns noErr if successful.

§Safety

  • in_component must be a valid pointer.
  • out_num_bytes must be a valid pointer.
  • out_packet_descriptions must be a valid pointer or null.
  • io_num_packets must be a valid pointer.
  • out_buffer must be a valid pointer.