[MPlayer-dev-eng] Equalizer

Anders Johansson ajh at atri.curtin.edu.au
Sat Jun 15 08:53:10 CEST 2002


Hi,

I have added an audio equalizer plugin. It is a 10 band octave eq
using 2nd order IIR filters, one for each band and channel. The gain
for each band can be adjusted between +/- 15 dB. The effect on
adjacent bands (i.e. Fc*2 and Fc/2) is 4dB when changing the gain for
a band with the center frequency Fc. I have made a fix-point 16 bit
implementation in C it is quite fast but slightly noisy (I think). At
the moment there is no UI and no possibility to save the settings so
it can not be used. If someone else feels like writing the OSD
interface please do so I don't really feel like doing it myself.

If you feel like trying it out look at my example below and read the
libao2/eq.h file and the comments in libao2/pl_eq.c. Also don't forget
to turn down the volume on your speakers before you begin (this is
alpha code).

I also need help to design a way to save the settings. I would like to
make the design of saving the settings expandable so that it can be
used by any plugin that has runtime adjustable controls. I am planning
to stuff around a bit with the volume control when I am done with the
new audio plugin interface, and add multichannel control and L/R - F/B
panning of the sound volume and listening position (yes I will put
back the switch for controling the master volume). This would also
benefit from being able to save the settings.

I would like to inlcude .ps or .gif images in the docuenation for the
equalizer is that ok?
 

Interface: 
The gain for the different frequency bands can be set or retrieved
through control as follows:

// Setting gain for band 2 to 10dB on channel 1
#include <eq.h>
#include <audio_plugin.h>

equalizer_t eq;
eq.band = 2;
eq.channel = 1;
eq.gain = 10;

audio_plugin_eq->control(AOCONTROL_PLUGIN_EQ_SET_GAIN,(int)&eq);



// Getting gain for band 2 on channel 1
#include <eq.h>
#include <audio_plugin.h>

equalizer_t eq;
eq.band = 2;
eq.channel = 1;

audio_plugin_eq->control(AOCONTROL_PLUGIN_EQ_GET_GAIN,(int)&eq);
printf("Gain = %f",eq.gain);



Cheers,
//Anders



More information about the MPlayer-dev-eng mailing list