CLEAR

Audio

You can easily add sound to your effect using an asset called a playback controller, and an object called a speaker.

Once an audio clip is applied to a playback controller, and a playback controller is applied to a speaker, sound will be rendered in your scene.

In this guide, you'll learn:

  • How to add continuous sound by making changes in the Inspector panel - this is the simplest way to add sound to an effect.
  • How to view and change the properties of the playback controller and speaker.

You can create more complex, interactive effects with sound by building graphs in the Patch Editor, or using scripting.

Before you start

Spark AR Studio supports mono M4A files. Use files with a 44.1kHz sample rate and 16-bit-depth resolution, to make the size of the effect as small as possible but preserve quality. You can do this through a DAW or a program like iTunes.

Audio clips should be prepped. If you're converting ambient or music beds from stereo tracks to mono, convert to summed mono rather than dropping one of the tracks - to avoid losing elements of the audio file. Convert files to the lowest kbps possible, while testing clips through the device. We don't recommend going lower than 64kbps when converting to m4as.

You can choose from range of free audio clips in the AR Library.

Adding a Continuous Audio Clip

1. Import an Audio Clip

First, import your audio clip into the Assets panel:

2. Create a Playback Controller

Next, create a playback controller in the Assets panel:

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

Playback Controller Properties

Audio

Apply an audio clip to the playback controller.

Play

Clicking the circle next to Play will create a patch in the Patch Editor. The patch can be used to play your audio clip based on a specific instruction.

Loop

Clicking the circle next to Loop will create a patch in the Patch Editor. Your audio clip will loop continuously, based on a specific instruction.

Checking the box next to Loop will play the audio clip assigned to the playback controller continuously as soon as your effect is opened, without creating a patch.

Stop

Clicking the circle next to Stop will create a patch in the Patch Editor. The patch can be used to stop your audio clip based on a specific instruction.

3. Apply the Audio Clip to the Playback Controller

To make your audio clip play continuously:

  1. Apply the audio clip next to Audio.
  2. Check the box next to Loop.

4. Insert and Configure the Speaker

Insert a speaker by clicking + in the Toolbar, and selecting Speaker.

Then, in the Inspector panel:

  1. Go to Audio. By default, it'll be set to None.
  2. Apply the playback controller you've added to the speaker.

You'll now have a continuous looping sound in your effect.

Speaker Properties

Visible

If you uncheck this box, the speaker will be hidden from the scene.

Audio

Add an audio clip from your computer, select a playback controller from the Assets panel or select the Microphone.

Volume

Adjust the volume level of the sound in the scene.

Transformations

Edit the position of the audio source in your scene.

Enable For

Choose the camera or cameras on a mobile device in which the audio should play.

Testing Audio

It's best to test effects on a device throughout the creation process, using the Spark AR Player app.

When testing, check:

  • You can hear the sounds you've added.
  • Ambient sound plays during preview and playback, and sits below your voice in the mix.
  • There's no popping sound or gap when a sound loops.
  • Scripted sounds play when they're supposed to, and aren't startling or too repetitive.