问题
I'm developing a simple audio player in java. The only advanced feature I need is a frequency filter. It's not necessarily a full-featured equalizer function, with different gains for specific frequency ranges: a low pass filter which cuts frequencies higher than a specified value would be enough.
I studied jlGui which has an equalizer, but it only works with MP3 data, while the files I will be playing are OGG.
Browsing through various answers I found that an ffmpeg wrapper like Xuggler or Jave could be a solution. But I didn't find any tutorial, not even a starting point on how to handle frequency filtering with ffmpeg.
Also JMF is described as a valid choice for implementing such a function, but I found nothing specific enough.
回答1:
http://www.cs.ubc.ca/~kvdoel/jass/doc/index.html
This is the JavaDoc for the JASS project by UBC Vancouver. It's free for non-commercial use. You should be able to implement most kinds of filters with it. Check the URL few levels up for actual source download.
回答2:
I'm ending up using this solution (for windows applications) : Equalizer APO
It makes use of the Audio Processing Object technology available on Windows Vista and later. My application just needs to edit a configuration text file and the APO does the rest.
Obviously, it is platform dependent, and I must install an external application for my filter to work, but it is acceptable in my case, and it is very easy to implement.
回答3:
I found an old project called JEQ
It is based on javax.sound and uses IIR to create a 10/15/25/31-band equalizer. It works on PCM data (not just MP3 like others) so I hope I can make it work with OGG. My only concerns are about output quality, which wasn't very good in some of my tests. I'll have to investigate
来源:https://stackoverflow.com/questions/11539455/java-audio-frequency-filter