Audio overview
A sound is emitted from a source, for instance a speaker or perhaps a vehicle in a Unity game. Sound is received by a listener in the real world, maybe a user's ears or a microphone.
Since we have two ears, just by listening to sound, we can tell many details about it:
- What was the weight of the object that emitted the sound?
- In what direction did the sound come from?
- Was it hollow or solid?
- What type of environment produced the sound?
- Is it a real or synthesized sound?
These details help us in our daily lives. They allow us to communicate verbally; they let us know if someone is trying to contact us, if our lunch is ready, and often they warn us of danger.
Unity has designed its audio system around these core principles with two primary components: the Audio Source and the Audio Listener.
The Audio Source is a component that is attached to GameObjects. A sound is assigned to the Audio Source, and it is either played on a constant loop or is triggered to play when certain conditions...