AudioFileWritePackets

Function AudioFileWritePackets 

Source
pub unsafe extern "C-unwind" fn AudioFileWritePackets(
    in_audio_file: AudioFileID,
    in_use_cache: bool,
    in_num_bytes: u32,
    in_packet_descriptions: *const AudioStreamPacketDescription,
    in_starting_packet: i64,
    io_num_packets: NonNull<u32>,
    in_buffer: NonNull<c_void>,
) -> i32
Available on crate features AudioFile and objc2-core-audio-types only.
Expand description

Write packets of audio data to the audio file.

For all uncompressed formats, packets == frames.

Parameter inAudioFile: an AudioFileID.

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

Parameter inNumBytes: the number of bytes being provided for write

Parameter inPacketDescriptions: an array of packet descriptions describing the packets being provided. Not all formats require packet descriptions to be provided. NULL may be passed if no descriptions are required.

Parameter inStartingPacket: the packet index of where the first packet provided should be placed.

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

Parameter inBuffer: a void * to user allocated memory containing the packets to write.

Returns: returns noErr if successful.

ยงSafety

  • in_audio_file must be a valid pointer.
  • in_packet_descriptions must be a valid pointer or null.
  • io_num_packets must be a valid pointer.
  • in_buffer must be a valid pointer.