AudioQueueNewInputWithDispatchQueue

Function AudioQueueNewInputWithDispatchQueue 

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

Creates a new audio queue for recording audio data.

Outline of how to use the queue for input:

  • create input queue
  • allocate buffers
  • enqueue buffers (AudioQueueEnqueueBuffer, not with parameters, no packet descriptions)
  • the callback receives buffers and re-enqueues them

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

Parameter inFormat: A pointer to a structure describing the format of the audio data to be recorded. 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 filling 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.