To create audio visualization from the sample spectral data, perform the following steps:
- Create a new 3D project and import the provided sound clip files.
- In the Inspector panel, set the background of the Main Camera to black.
- Set the Main Camera Transform Position to (224, 50, -200).
- Set the Main Camera Camera component to have the following settings:
- Projection = Perspective
- Field of View 60
- Clipping Planes: Near = 0.3
- Clipping Planes: Far = 300
- Add DirectionalLight to the scene. You can do this by navigating to GameObject | Light | Directional Light.
- Add a new empty GameObject, named visualizer, to the scene. Add an AudioSource component to this GameObject, and set its AudioClip to one of the 140 bpm loops provided. Check the Loop option.
- Create a C# script class, called SpectrumCubes, in a new folder, _Scripts, that contains the following code. Also, add an instance as a scripted component to the visualizer GameObject:
using UnityEngine...