Can I use the Android Visualizer class on a SoundPool object?

When using the SoundPool sound class, it definitely has some advantages over MediaPlayer when playing short audio clips easily. I noticed that SoundPool is much faster. MediaPlayer can lag a little on startup and it's much easier to go from one audio clip to another where I don't have to stop, reset, cook every time.

However, is it possible to use the renderer to get real-time data in real time from the audio data being played in the SoundPool, just like with the MediaPlayer? I couldn't come across any topics that cover this, but by chance, I thought I would ask because it seems like it should be possible. The documentation says, "The SoundPool library uses the MediaPlayer service to decode audio to a raw 16-bit mono or stereo PCM stream." So if I could refer to the MediaPlayer that SoundPool uses, I think I could just use getAudioSessionId()

, perhaps?

I've already tried setting the session id to 0 to just get the output set. It didn't work, but it's not the ideal effect I'm looking for anyway. Also one of the first things I did was try to use the downloaded SoundPool SoundID instead of the renderer session id, but that also didn't work.

+3


source to share





All Articles