How to create and use an Equalizer |
|
Audio Sound Recorder for .NET comes with an embedded equalizer which allows setting up a pool of equalizer bands; each equalizer band works on a different frequency and the current available range of frequencies is from 1 to 16000 Hz.
Each equalizer band is always identified by its frequency expressed in Hertz: it's not possible defining more than one band having the same frequency. Note that a band's frequency cannot exceed one-third of the frequency of the recording session so, if you have started a recording session with a frequency of 44100 Hz, the maximum allowed band's frequency will be 14700 Hz (14700 * 3 = 44100); in order to reach a band's frequency of 16000 Hz, you must start a recording session whose frequency is at least 48000 Hz.
The first step for creating an equalizer band and for adding it to the control's equalizer is to call the EqualizerBandAdd method. Each band can be removed at a later time using the EqualizerBandRemove method and its settings can be retrieved through the EqualizerBandParamsGet method and modified through the EqualizerBandGainSet and EqualizerBandParamsSet methods.
Existing bands can be enumerated using the EqualizerBandCountGet and EqualizerBandFrequencyGet methods.
Once the equalizer has been defined, there is the possibility to store its bands and their respective settings into a destination file through the EqualizerSaveToFile method and retrieved at a later time through the EqualizerLoadFromFile method.
Equalizer settings are stored into a XML based file (usually with .EDJ extension) and has a structure like the sample below:
<?xml version="1.0" ?>
<Equalizer>
<Bands>
<Band FreqInHz="80" BandWidth="12" GainIndB="-5.200000">0</Band>
<Band FreqInHz="170" BandWidth="12" GainIndB="3.750000">1</Band>
<Band FreqInHz="310" BandWidth="12" GainIndB="0.000000">2</Band>
<Band FreqInHz="600" BandWidth="12" GainIndB="-4.500000">3</Band>
<Band FreqInHz="1000" BandWidth="12" GainIndB="-3.000000">4</Band>
<Band FreqInHz="3000" BandWidth="12" GainIndB="1.125000">5</Band>
<Band FreqInHz="6000" BandWidth="12" GainIndB="5.250000">6</Band>
<Band FreqInHz="12000" BandWidth="12" GainIndB="6.750000">7</Band>
<Band FreqInHz="14000" BandWidth="12" GainIndB="-3.120000">8</Band>
</Bands>
</Equalizer>
As you can see each band has a progressive number (in the case above from 0 to 8) and is identified by the frequency stored inside the FreqInHz attribute (expressed in Hertz) while its parameters are defined inside the BandWidth (expressed in semi-tones) and GainIndB (expressed in dB) attributes.
EDJ format is also used by our Audio DJ Studio for .NET and Audio Sound Editor for .NET components.
A further feature for setting up the equalizer is to load bands containing presets as defined by WinAmp™ using the qualizerLoadPresets method.
The equalizer can be enabled or disabled, without changing parameters of various bands, through the EqualizerEnable method and the gain of available bands can be reset to 0 dB using the EqualizerReset method.
Samples of use of Equalizers in Visual C#.NET and Visual Basic.NET can be found inside the following samples installed with the product's setup package:
- Equalizer