Time to make some noise!
I mentioned in a previous post just how unsettling the whole Post Processing set of tools was for me. Obviously, that will take some time for me. Thankfully, adding some basic sounds is not. whew! Adding sounds takes us mostly back to the realm of point and click and simple scripts.
So today, we’ll add a simple, repeating loop for background music and setup a basic audio management infrastructure.
In our Hierarchy, create an empty object and rename it ‘Audio Manager.’ Note: the Main Camera already has an Audio Listener component, but we will let that one sit for now in favor of a dedicated manager. Create another empty object as a child to the Audio Listener and name it ‘Background Music.’ To this object, add an ‘Audio Source’ component. As you might rightfully guess, drag and drop our background music audio asset into the ‘Audio Clip’ field. Ensure the ‘Play on Awake’ and ‘Loop’ checkboxes are selected and that is that. Fire up the game and you should now be hearing music!
As with the Post Processing, the Audio components are simple enough that even a programmer can do some basic things. But now we see a glimpse of the bigger picture. Unity is a cross-discipline tool, allowing skilled practitioners in all of these fields to come together and collaborate. Programmers, Artists, Sound, Designers, etc. may do much of their work outside of Unity, but Unity is where they gather to assemble and tweak the final product.