Cinematography in Unity — Working With Audio In Timeline

Joshua Nielsen
3 min readDec 31, 2021

Tips for getting your audio assets in line with the rest of your work

Photo by John-Mark Kuznietsov from Pexels

We continue to learn the art of cinematography in Unity by beginning to work with audio in Unity. What do I mean by cinematography in Unity? By that I mean the intelligent use of Unity cameras and visual tricks to make the best looking games we can. Or, with this article, the best sounding games as well.

Even in the world of video games, we are well into the age of “talkies”, and audio/sound work is every bit as important as other aspects of a game (short of gameplay, at least).

However, the goal of this article is not to teach how to make quality sound effects, voice acting, and music, but instead how to integrate these elements into the scenes we have been working with. Let’s get started.

Adding audio to Timeline

The first thing we’ll need to add audio assets to our Timelines is to have a game object in our scene with the Audio Source component. This can done by simply adding an empty game object then adding the Audio Source component in the Inspector window.

We may even want multiple objects to act as audio sources, in order to separate different audio types such as voices or music.

A game object with Audio Source in the Inspector window

We don’t need to mess with any of the settings on this object at this time.

Next, we go to our Timeline (or make one, if necessary) and then add an Audio Track to the Timeline. Once the track is added, attach the Audio Source to the Audio Track. Finally, add an audio asset by dragging one on to the track.

Once on the track, we can then adjust when we want the audio asset to play during our Timeline. We may have other tracks on our Timeline, such as virtual cameras or animations, that we may wish to coordinate with our audio assets on the Timeline.

A Timeline with audio tracks

And that’s it! Matching audio to our animations and camera shots couldn’t be easier.

Bonus tip — organizing the Timeline

Working with audio in Timeline is so easy I decided to give all you readers a bonus tip for working with Timeline.

You might notice as your building a particularly involved cutscene that the list of tracks starts to grow long and unwieldy as you pile on more animations, audio clips, and who knows what else. Fortunately, Unity has thought of this and has a solution.

Go to your Timeline and find the Add button, just like if we wanted to add a new track. There, at the top of the list, is the option to add a Track Group. A Track Group acts as an organizing container for other tracks in the Timeline.

We can add tracks to a Track Group by simply dragging them into it. Once tracks are in the Track Group, we are able to collapse the entire group in the Timeline by clicking the little arrow to the left of the group.

We can also rename our Track Groups in the Inspector window when we have selected them. Very convenient!

Conclusion

I think we have found that working with audio in Timeline is just as easy as working with anything else. Good thing, too, because audio is such an important component to making high quality movies and games.

And that wraps up our exploration of cinematography, at least for the time being. Next time, we’re going to get into some actual gameplay again by learning what we need to know to make a stealth game! Until then, thanks for reading.

--

--