O'Reilly logo

Developing AR Games for iOS and Android by Dominic Cushnan, Hassan EL Habbak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding audio sources

We now need to create sound sources in the scene to handle sound effects for the game. Sound sources are audio sources that can be position in the world for 3D positional sound or simple 2D sounds. In order to hear sound effects in the game, audio sources are needed to produce the sound, but also we need a listener to actually capture the created sound to present to the user.

By default, ARCamera has a listener component added to it, so we only need to add the audio sources to it.

  1. Create a folder and name it Audio in the Assets folder. Drag-and-drop the two files inside the Audio folder in the chapter's assets. This will import the two audio files named ballFire.wav and moleHit.wav. We will use the first for the sound effect ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required