Does Android Visualizer FFT / waveform affect device volume?

I am working on some music analysis using the Visualizer class on Android 2.3.1. I find that the size of the FFT and waveform is affected by the volume of the device. This means that if the user has a volume, I get little or no FFT data.

I tested this on a Motorola Xoom, Samsung Galaxy Tab and emulator, and it behaves that way.

I am using the following code:

mp = new MediaPlayer(); mp.setDataSource("/sdcard/sine1.wav"); mp.prepare(); mp.setLooping(true); mp.start(); int audioSessionID = mp.getAudioSessionId(); v = new Visualizer(audioSessionID); v.setEnabled(true); 

Looking at the documents for the Visualizer class , it seems that if we pass a valid identifier for an audio session, then the visualizer should work with this audio session. Visualizer seems to be working on an output connection.

Has anyone else come across this or found a way around it?

thanks

+8
android fft audio media-player visualizer
source share
1 answer

I also had a problem with the same problem, but it works when I turned on Eqaulizer and Visualizer for the same session id. I do not know the reason for this, I checked it to remove the equalizer from the visualizer class in the demos api, this is how you said.

  Equalizer mEqualizer = new Equalizer(0, SessionId); mEqualizer.setEnabled(true); // need to enable equalizer Visualizer mVisualizer = new Visualizer(SessionId); 
+11
source share

All Articles