Audio Source

An Audio Source is a component that is used to play back sound in the application space. Attached to GameObjects, Audio Sources can be moved along with the GameObjects to create the effect of moving sound. Imagine that a car is coming down your street with its horn held down. If you were standing outside on the street as it went by, you would be able to determine that the horn was in the front of the vehicle. If someone runs their fingernail down a chalkboard--assuming you are not completely freaking out from the sound--you would be able to see and hear that the sound was coming from where the fingernail touches the chalkboard. The sound sources have an obvious point of origin. 

The same applies to the Audio Source component. In a game, every single sound would have an associated Audio Source. Often, the sources are attached to the objects emitting the sounds. In the fingernail and chalkboard example, the Audio Source will be connected to the finger. In the car horn example, the Audio Source component is attached to the horn itself.

Unlike the Audio Listener component, this component has many changeable parameters as you can see in the following screenshot; some of these parameters are options such as Loop, Pitch, or Spatial Blend

We will get into the options that we need in just a minute, but, for now, we need to get some details about spatial sound.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.93.44