AudioFileReadPackets

Function AudioFileReadPackets 

Source
pub unsafe extern "C-unwind" fn AudioFileReadPackets(
    in_audio_file: AudioFileID,
    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: *mut c_void,
) -> i32
👎Deprecated: no longer supported
Available on crate features AudioFile and objc2-core-audio-types only.
Expand description

Read packets of audio data from the audio file.

AudioFileReadPackets is DEPRECATED. Use AudioFileReadPacketData instead. READ THE HEADER DOC FOR AudioFileReadPacketData. It is not a drop-in replacement. In particular, for AudioFileReadPacketData ioNumBytes must be initialized to the buffer size. AudioFileReadPackets assumes you have allocated your buffer to ioNumPackets times the maximum packet size. For many compressed formats this will only use a portion of the buffer since the ratio of the maximum packet size to the typical packet size can be large. Use AudioFileReadPacketData instead.

Parameter inAudioFile: an AudioFileID.

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_audio_file 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 or null.