In this tutorial we explain how to add sound to AR scenes. Sound is important, as it changes the perception and realism of a scene. Typical examples for sounds in AR include audioguides that are triggered through user interaction or background music.

We will explain the concept auf sound by using the following example scene:

The scene shows the human limphatic system. Labels highlight the different nodes and an audio file is being played when the user clicks on it.

Upload audio files

Before you can add sounds to a scene, you need to upload audio files as an .mp3 file to Onirix Studio.

Audio modes

Three different audio modes are available:

  • Autoplay: if enabled, the audio file is played automatically when the scene is entered; mostly used for background sounds
  • Loop: the audio file is played again and again; useful for background music or environmental sounds
  • Positional: the audio file is played, depending on the position of the user within the scene.

The following example scene is using background sounds. The whale sounds are being looped.

Now, we are coming back to our limphatic system example from before. We want to include different audio files for different labels. As we want the sound to be triggered by user interaction, in this case a click on a label, we disable Loop and Autoplay.

Include events to trigger sounds

AR scenes can include different events to make scenes interactive. In this case we want to include the following behaviour:

When the user clicks on a label, the coresponding audio file for the selected node will be played.

In this case, we need to create a new click event for every label. First, we select the label in the Element bar, then we add a new event (type Click). Afterwards, we select the action (Play / Pause), and finally, we select the audio file we want to play.