How can I select output for AUAudioUnit

Generated on 7/31/2024

1 search

To select the output for an AUAudioUnit, you can follow these steps as demonstrated in the session Enhance your spatial computing app with RealityKit audio:

  1. Instantiate the Audio Unit: Create an instance of your custom audio unit.
  2. Prepare Configuration: Set up the configuration for the audio generator controller.
  3. Create Output Format: Define the format for the output of the audio unit.
  4. Set Output Bus: Apply the output format to the audio unit's output bus.
  5. Allocate Render Resources: Allocate the necessary render resources for the audio unit.
  6. Capture Render Block: Capture the audio unit's internal render block.
  7. Configure Audio Generator: Configure the audio generator controller with the audio generator configuration.
  8. Call Render Block: Finally, call the audio unit's internal render block on the audio data provided in the audio generator's callback.

This process allows you to control the rendering of the buffers and manage the output of your audio unit effectively. For more detailed information, you can refer to the session Enhance your spatial computing app with RealityKit audio.