简体   繁体   中英

FFT Data from Android Visualizer dependent on volume

I've been struggling with this for the past hour and it's driving me nuts. I'm making a music app, and i want to have a visualizer built in. I have a MediaPlayer object, and I'm linking a Visualizer to that player's session id, but the data I get is dependent on the volume. I've tried initializing an Equalizer before and after the visualizer, and I've tried changing the audio stream to music in the activity, but nothing is working.

How can I make the visualizer not dependent on the output volume of the device?

You should use this: setVolumeControlStream (AudioManager. STREAM_MUSIC); in your activity, if you have a fragment you can call it with getActivity() . Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM