How can I get Audio Stream from MediaPlayer in Android

910 Views Asked by At

I tried to display audio stream for visualization, and I found MediaPlayer.snoop(short[], int) to get audio stream playing now on Mediaplayer

So I did the code:

Class c = MediaPlayer.class;
Method m = c.getDeclaredMethod("snoop", outData.getClass(), Integer.TYPE );

But there is an exception error: No such function in Mediaplayer

Couldn't I use the code above or is it impossible to get audio stream?

Help me!! Thank you.

1

There are 1 best solutions below

0
On

The snoop api is not made public yet(i.e it is not exposed for use outside), so you cannot use it in your application unless you plug your application in android source code and compile the antire android source code.