Unity Sound

smallarrows.GIF

Written by Alex Rickett

Save at least one sound file into your Assets folder

Basically any file format is OK (wav, aiff, mp3, mp4, ogg)
https://www.freesfx.co.uk/


Background Looping Sounds
Add an AudioSource to the object you want to make a sound.  (If you want it to be an ambient sound, like background music, you can create a new empty object and put it on that.)

Select the object to have sound in the
Hierarchy

Select Add Component->Audio Source
     Drag an drop a sound clip from the Assets tab onto the slot for AudioClip,

Check the Loop box, if you would like it to play more than once.

Set the spatial blend as needed.
(set to 3D if you only want the sound to be quiet/silent when you are not close to the object.  Set to 2D if you want the sound to be audible all the time e.g. background music.  You can control this in greater detail  in 3D sound settings at the bottom of an AudioSource component).


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Sound when you touch an object


Select your object that will play sounds


Select Add Component->Audio Source
     Drag an drop a sound clip from the Assets tab onto the slot for AudioClip,
     Uncheck the Play on Awake
.

(Next steps are very similar to playing an animation with the trigger)
Select the Maya Model in the Hierarchy
Use Add Component
     Search for inter
     Select Interactable Hover Events
Hit the + under On Hand Hover Begin () in the Inspector

Drag and drop Model from the Hierarchy onto None (Object) in the Inspector
Click the drop down menu reading No function and choose Audio Source->Play()
unity_steam_audio_event

On Attached To Hand () uses the trigger by default



If you do not hear your sound
PC: Select the audio icon in the lower right side of the screen.
vive_falcon_audio


Make sure the headset is active.
Headphones are connected to the headset
The sound output should be Vive