Articles
Audio
The Audio Playback Controller

The Audio Playback Controller

The audio playback controller can be used to play sound continuously on a loop in your AR effect or add one-shot triggered audio in response to boolean signals.

It must be connected to a speaker, which will render the sound in the scene.

Adding an audio playback controller

Create an audio playback controller in the Assets panel:

  1. Click Add Asset.
  2. Select Audio Playback Controller.

An asset called audioPlaybackController0 will be listed in the Assets panel.

Configuring the audio playback controller

To connect an audio file to the audio playback controller:

  1. Go to the Inspector.
  2. Next to Audio, click the dropdown and select the audio file.

Then connect the audio playback controller to a speaker in your scene, again through the speaker's Audio property

You can then edit the audio playback controller's properties to add looping and one shot audio.

Audio playback controller properties

When the audio playback controller is selected in the Scene panel, you'll see its properties in the Inspector:

Audio

Apply an audio clip to the playback controller.

Play

Checking the box next to Play will play the audio clip once when the effect is opened.

Clicking the arrow next to Play will create a patch in the Patch Editor. The patch can be used to play an audio clip when a boolean signal is ‘true’.

The patch graph below will cause the audio clip to switch between playing and stopping each time a tap is detected on the device screen. The clip will play from the position it stopped at:

Loop

Checking the checkbox next to Loop will play the audio clip continuously as soon as the effect is opened.

Clicking the arrow next to Loop will create a patch in the Patch Editor. Your audio clip will loop continuously while a boolean input is ‘true’.

Reset

Clicking the arrow next to Reset will create a patch in the Patch Editor.

The patch can be used to stop your audio clip in response to a boolean signal. The clip will always be reset to the beginning. If the clip is already playing or looping it will reset to the beginning and continue playing. If not, it will play from the beginning next time the Play value is set to true.

The patch graph below will cause the audio clip to switch between playing and stopping each time a tap is detected on the device screen. The clip will reset from the beginning each time:

Was this article helpful?