17.1 Generating Audio Output

The basic process for generating, and playing audio can be summed up by the following steps.

  1. Create and initialize the necessary resources. (Typically, an audio heap, a synthesizer, and a player)

  2. Repeatedly make calls to alAudioFrame to generate the audio task lists.

  3. Execute these audio task lists on the RSP.

  4. Set the output DAC to point to the audio output, with a call to osAiSetNextBuffer

The creation and initialization of the necessary resources is somewhat dependent on your applications needs, but typically you will need to take the following steps.

  1. Create an audio heap with a call to alHeapInit

  2. Set the hardware output frequency with a call to OsalSetFrequency

  3. Create a synthesizer with a call to alInit(). (alInit will require that you have a callback routine to initialize the audio DMA structures)

  4. Create message queue for receiving signals that allow you to time your audio processing.

  5. Create a player, (such as a sound player or sequence player) to sign into the synthesizer.

  6. Initialize the resources assigned for each player that you have created.

UP