Summary
In this chapter, we built a music visualizer that runs as a Cardboard VR application. We designed a general architecture that lets you define multiple visualizations, plug them into the app, and transition between them. The app uses the Android Visualization
API to capture the waveform and FFT data from the phone's current audio player.
First, we defined the VisualizerBox
class responsible for the activity and callback functions to the Android Visualizer
API. Then, we defined an abstract Visualization
class to implement a variety of visualizations. We then added waveform audio data capture to VisualizerBox
and used it to parametrically animate a series of cubes to make a 3D wavy box. Next, we wrote a second visualizer; this time using waveform data to dynamically generate a texture that is rendered with material shader programs. And lastly, we captured the FFT audio data and used it for a third visualization. Then, we added more fun with a trippy trails mode and multiple concurrent...