AudioQueueNewOutputWithDispatchQueue

Function AudioQueueNewOutputWithDispatchQueue 

Source
pub unsafe extern "C-unwind" fn AudioQueueNewOutputWithDispatchQueue(
    out_aq: NonNull<AudioQueueRef>,
    in_format: NonNull<AudioStreamBasicDescription>,
    in_flags: u32,
    in_callback_dispatch_queue: &DispatchQueue,
    in_callback_block: AudioQueueOutputCallbackBlock,
) -> i32
Available on crate features AudioQueue and block2 and dispatch2 and objc2-core-audio-types only.
Expand description

Creates a new audio queue for playing audio data.

To create an playback audio queue, you allocate buffers, then queue buffers (using AudioQueueEnqueueBuffer). The callback receives buffers and typically queues them again. To schedule a buffer for playback, providing parameter and start time information, call AudioQueueEnqueueBufferWithParameters.

Parameter outAQ: On return, this variable contains a pointer to the newly created playback audio queue object.

Parameter inFormat: A pointer to a structure describing the format of the audio data to be played. For linear PCM, only interleaved formats are supported. Compressed formats are supported.

Parameter inFlags: Reserved for future use. Pass 0.

Parameter inCallbackDispatchQueue: The dispatch queue from which inCallbackBlock is to be called.

Parameter inCallbackBlock: A pointer to a callback block to be called when the audio queue has finished playing a buffer.

Returns: An OSStatus result code.

ยงSafety

  • out_aq must be a valid pointer.
  • in_format must be a valid pointer.
  • in_callback_dispatch_queue possibly has additional threading requirements.
  • in_callback_block must be a valid pointer.