4
Playing and Manipulating Sounds
Sound is a very important part of the gaming experience. In fact, we can’t stress enough how crucial sound is to a player’s immersion in a virtual environment. Just think of the engine running in your favorite racing game, the distant urban buzz in a simulator game, or the creeping noises in horror games. Think of how these sounds transport you into the game.
Before we get into the recipes, first, let’s review how different sound features work in Unity. A project with audio needs one or more audio files. These are called AudioClips
in Unity, and they sit in your Project
folders. At the time of writing, Unity supports four audio file formats: .wav
, .ogg
, .mp3
, and .aif
. Files of these types are re-encoded when ...
Get Unity Cookbook - Fifth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.