2

I found the function MediaPlayer.snoop(short[], int) in Accessing the Android media stream for audio visualization but I couldn't use it.

I am wondering there is a method snoop in MediaPlayer.class. Looks it is not public method but private one of MediaPlayer. If there is how can i get audio stream from that method.

Thank you.

Community
  • 1
  • 1

1 Answers1

3

Look at the GrabAudio class of this open source wallpaper app,

https://bitbucket.org/Metastable/deadmau5-audio-visualizer/src/249150da7cfa2c20e8d1456a31aaabd46df6d26d/src/com/metastable/deadmau5?at=default

This is a magic class that will get tons of audio data. Very useful source.

This is the other open source app that you can look at but it doesn't seem to get audio data from the output, it just loads a media player and analyzes that one.

https://github.com/felixpalmer/android-visualizer

Karl Floersch
  • 327
  • 4
  • 15