Android Visualizer implementation crash

后端 未结 6 2008
粉色の甜心
粉色の甜心 2020-12-03 09:26

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

6条回答
  •  盖世英雄少女心
    2020-12-03 10:13

    @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.
    

提交回复
热议问题