pub unsafe extern "C-unwind" fn AudioQueueEnqueueBufferWithParameters(
in_aq: AudioQueueRef,
in_buffer: AudioQueueBufferRef,
in_num_packet_descs: u32,
in_packet_descs: *const AudioStreamPacketDescription,
in_trim_frames_at_start: u32,
in_trim_frames_at_end: u32,
in_num_param_values: u32,
in_param_values: *const AudioQueueParameterEvent,
in_start_time: *const AudioTimeStamp,
out_actual_start_time: *mut AudioTimeStamp,
) -> i32
AudioQueue
and objc2-core-audio-types
only.Expand description
Assigns a buffer to an audio queue for playback, providing parameters and start time information.
You can exert some control of the buffer queue by using this function. You can assign audio queue settings that are in effect carried by an audio queue buffer as you enqueue it. Hence, these changes only take effect when an audio queue buffer begins playing.
This function queues a buffer for playback only, not for recording. Audio queues for recording have no parameters, do not support variable-bit-rate (VBR) formats (which might require trimming), and have a different way to handle timing. When queued for playback, the buffer must contain the audio data to be played back. See AudioQueueEnqueueBuffer for details on queuing a buffer for recording.
If the buffer was allocated with AudioQueueAllocateBufferWithPacketDescriptions, the client should provide packet descriptions in the buffer’s mPacketDescriptions and mPacketDescriptionCount fields rather than in inPacketDescs and inNumPacketDescs, which should be NULL and 0, respectively, in this case.
Parameter inAQ
: The audio queue associated with the buffer.
Parameter inBuffer
: The buffer to be played from.
Parameter inNumPacketDescs
: The number of packet descriptions pointed to by the inPacketDescs parameter. Required
only for variable-bit-rate (VBR) audio formats. Pass 0 if no packet descriptions are
required.
Parameter inPacketDescs
: A pointer to an array of audio stream packet descriptions. Required only for VBR audio
formats. Pass NULL if no packet descriptions are required.
Parameter inTrimFramesAtStart
: The number of priming frames to skip at the start of the buffer.
Parameter inTrimFramesAtEnd
: The number of frames to skip at the end of the buffer.
Parameter inNumParamValues
: The number of parameter values pointed to by the inParamValues parameter.
Parameter inParamValues
: An array of parameter values. (In macOS v10.5, there is only one parameter,
kAudioQueueParam_Volume.) These values are set before buffer playback and cannot be
changed while the buffer is playing. How accurately changes in parameters can be
scheduled depends on the size of the buffer. If there are no parameters to set
(inNumParamValues = 0), pass NULL.
Parameter inStartTime
: A pointer to a structure containing the desired start time for playing the buffer. If
you specify the time using the mSampleTime field of the AudioTimeStamp structure, the
sample time is relative to the time the queue started. If you pass NULL for the start
time, the buffer starts immediately after the previously queued buffer, or as soon as
possible if no buffers are queued ahead of it. Buffers are played in the order they are
queued. If multiple buffers are queued, their times must be in ascending order or NULL;
otherwise, an error occurs. The start time indicates when the actual audio data in the
buffer is to be played (that is, the trim frames are not counted).
Note: When specifying a start time for a buffer, if the buffer is not the first enqueued since AudioQueueStop or AudioQueueReset, it is normally necessary to call AudioQueueFlush before AudioQueueEnqueueBufferWithParameters.
Parameter outActualStartTime
: On return, points to an AudioTimeStamp structure indicating when the buffer will
actually play.
Returns: An OSStatus result code.