简体   繁体   中英

android MediaPlayer from url make it sound louder/amplify (not just volume up)

I play an mp3 file from url with android MediaPlayer class.

(everything works fine)

I want to amplify the sound, make it sound louder.

I don't mean just raise the device volume but to actually amplify the sound.

even in cost of loosing some quality.

(I want it to be done in code and not with 3rd party software) maybe with some kind of java library.

MediaPlayer doesn't have a out-of-the-box method for this. Doing what you try to do really goes in the direction of audio-manipulation. This means, that you should get the byte stream and modify it for your needs. Eg read the MP3 specification and try to rise the amplitude.

A better approach would be to edit your current mp3 files with a professional desktop editing program and play the files just the usual way.

As per my understanding, this may not be directly allowed in MediaPlayer and you may need some mp3- manipulation algorithm or library to do this. I am looking into this, but you can use the following as a starting point:

Looks like you're not supposed to directly use, that but one of its subclasses:

  1. Equalizer
  2. Virtualizer
  3. BassBoost
  4. PresetVerb
  5. EnvironmentalReverb

Maybe it will help you, but I'm not exactly sure how to implement it. Will look into it.

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