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
@Kaushal28, @ihsan,gaozp, @Big Money
-3 error code means ERROR_NO_INIT Note: https://developer.android.com/reference/kotlin/android/media/audiofx/Visualizer
I had the same experience and used the AudioRecorder's audioSesstionId.
If you check the documentation of Visualizer, you can use only MediaPlayer and AudioTrack as shown below.
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.