I am trying to implement the Android Visualizer class. I have looked up other trouble threads but I am still getting a fatal error. This all looks to me like it should work
There are some important things for using Visualizer.
api level must be equal to or greater than 9.Visualizer engine, error: -1 means RECORD_AUDIO permission is
missing.Visualizer engine, error: -4 means Operation failed due to bad parameter. value. something bad in the configuration of the Visualizer, you don't properly setup Visualizer.And also see my answer here.
Note
Parameters (audioSession) system wide unique audio session identifier. If audioSession is not 0, the visualizer will be attached to the MediaPlayer or AudioTrack in the same audio session. Otherwise, the Visualizer will apply to the output mix.