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,
) -> i32AudioFile 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_filemust be a valid pointer.out_num_bytesmust be a valid pointer.out_packet_descriptionsmust be a valid pointer or null.io_num_packetsmust be a valid pointer.out_buffermust be a valid pointer or null.