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 fly sonicstate newsletter - delivered to your in box every week
More From: UNITY
Even more news...


 

Get Our Newsletter


More...

Eventide H910 and more


5 MINUTES WITH ODD-1 Granular Instrument 

Multiple engines of granular joy


Broke Beats pt2 - A £30 DAW & Microcomputer 

M5Stack Cardputer ADV is an ESP32 S3-Powered Wonder


Sega Genesis/Mega Drive Sounds on the Carbon 8 

Creating Twangy Sega Tones on Modal's Synth


Presentation: Sonible Smart Chain Mix Plug-in 

Balance and process multi-track sessions


UDO DMNO ON - Desktop DMNO System 

Desktop DMNO and expanders...