Blog: Game Audio Scripting With Unity - Part 1

US Game audio development platform revealed      03/03/14

Unity saw that we were dragging audio assets into the Scene and created two new GameObjects, each with an Audio Source. If look at the Audio Source components you'll see something like this:

Now, click the play button at the top of the Unity UI. You should hear both clips play once. Click the stop button when done.

Looking more closely at the screen above:

  • Play on Awake: this tells Unity to play the sound right away, as soon as the scene starts.
  • Loop: the default is unchecked, so the sounds will only play once.

Go ahead and check "Loop" for the music. Play the scene again and the music will loop, while the sound effect will play only once.

This is a good time to mention the requirements for seamless looping: generally you will need to use WAV files to achieve seamless looping. The exception is if you're building a project for Android or iOS: you will have the option to compress the audio and also specify "Gapless looping". You will still need to start by importing a WAV file though, but Unity will take care of the compression part.

Send us your News: If you have a story or product you'd like us to cover - email news@sonicstate.com or use our contact form or join our Discord and post in #cool-finds


Get the latest headlines, offers and more in our excellent sonicstate newsletter - delivered to your in box every week

More From: UNITY
Even more news...


 

Get Our Newsletter


More...

SonicLAB: Genki Katla With Venus Theory 

We look at the volcanic synth


Lifeforms SV-2 - Pittsburgh Modular's Redesigned Semi-Modular 

SV-1 successor with thru-zero FM


SonicLAB: Pittsburgh Modular Lifeforms SV-2 

Classy analogue synth reviewed


AmiGUS mini: 24-bit Sound for Amiga 1200 & 600 

32 Channel PCMCIA Soundcard in Beta


SonicLAB: Lambda Synthetics Polypulse 

Algorithmic Performance Workstation


Will Vintage Gear become Liquidated E-Waste? 

Geopolitics, CRTs, Antique Computers & Vintage Synths