World Anchors
Goals
- Make the bees buzz, according to relative position to user
5. Let's have some sound
These hives are full of bees, let's make them sound like it.
- Enable the Spatial plugin by:
- Open the menu
Edit
-Project Settings
-Audio
- Set Spatializer Plugin to
MS HRTF Spatializer
- Set System Sample Rate to
48000
- Open the menu
- Download a bee buzzing sound and put it in
Assets/Sounds/buzz.wav
- This sound is courtesy of pillonoise on freesound.org
- Unity will pick it up and import it
- Select your
Beehive
game object - Click
Add Component
and chooseAudio Source
- Note your camera already has the
Audio Listener
Component
- Note your camera already has the
- Configure the Audio source:
- Drag the
buzz
sound to the Audio Clip - Select
Spatialize
- Select
Play on Awake
- Select
Loop
- Set
Spatial Blend
to1
- In 3D Sound Settings:
- Set Volume Rolloff to
Logarithmic Rolloff
- Min Distance to
1
- Max Distance to
20
- Set Volume Rolloff to
- Drag the
Now we're buzzing with excitement!
The effect works best if you're wearing headphones (or the Hololens), but you should be able to tell (without looking at the screen) whether the bees are in front, beside or even behind you. The sound drops off as you move away, and it louder as you get closer - pretty good results for the minimal effort
At this point, it doesn't quite go as far as making it sound like the audio is going around corners or being muffled by doors, but some of this is possible using the Audio Occluder
script. For now, we'll leave it as-is.
Next: Voice Input: Control the bees
Prev: Add a beehive