Adding equalizer to the Symbian C++ audio player
Symbian has several audio enhancement APIs that can be used to modify the audio experience. One of them is the CAudioEqualizerUtility API. This snippet can be self-signed.
Article Metadata
Code Example
Source file: Media:PlayerExtrasExample.zip
Tested with
Devices(s): Nokia N95
Compatibility
Platform(s): S60 3rd Edition
Platform Security
Signing Required: Self-Signed
Capabilities: None
Article
Keywords: CAudioEqualizerUtility, TEfAudioEqualizerUtilityPreset
Created: User:Technical writer 1
(09 Oct 2008)
Last edited: hamishwillee
(03 Dec 2012)
Contents |
Preconditions
The audio player must be fully constructed before constructing the instance of the API. This can be done with the following lines of code:
iMdaAudioPlayerUtility = CMdaAudioPlayerUtility::NewFilePlayerL(aFileName,
*this,
EMdaPriorityNormal,
EMdaPriorityPreferenceTimeAndQuality);
MMP file
The following capabilities and libraries are required:
CAPABILITY NONE LIBRARY AudioEqualizerUtility.lib Header audioequalizerutility.h
Source file
First you need to construct the equalizer instance:
iAudioEqualizerUtility = CAudioEqualizerUtility::NewL(*iMdaAudioPlayerUtility);
Use the following code to query equalizer presets:
TArray<TEfAudioEqualizerUtilityPreset> allPresets =
iAudioEqualizerUtility->Presets();
Use the following code to apply an equalizer preset:
iAudioEqualizerUtility->ApplyPresetL(preSetIndex);
// where preSetIndex is 0 to (iAudioEqualizerUtility->Presets().Count() – 1)
Test application
See also
- Adding doppler effects to the audio player in Symbian C++
- Adding source location effects to the Symbian C++ audio player
- Adding listener's location effects to the Symbian C++ audio player
- Adding bass boost to the Symbian C++ audio player
- Adding stereo widening to the Symbian C++ audio player
- Adding reverb to the Symbian C++ audio player


Dear all!
Background: I have successfully built and installed the example application Image:PlayerExtrasExample.zip on my Nokia N95 device using the demo signing site from Symbian (symbiansigned.com)
Problem: However, when I try to extend the application, trying to create a new Preset for the equalizer I run into various truble:
The new equalizer preset itself is indeed created and I can see and choose it in the equalizer list from the N95 media player equalizer preset list. BUT the equalizer band settings I wished to store within this new presest is not stored at all. I.e only the default settings are contained within the new equalizer preset.
Can any hint me what I do wrong here?
The altered code is stated below:
TInt32 levelMin, levelMax;
// this exists ok on target if(iMdaAudioPlayerUtility) {
if(iAudioEqualizerUtility == NULL) { iAudioEqualizerUtility = CAudioEqualizerUtility::NewL(*iMdaAudioPlayerUtility); // this exists ok on target }iBandNum = iAudioEqualizerUtility->Equalizer().NumberOfBands(); //this is printed in the device N95 and is correctly = 8 iAudioEqualizerUtility->Equalizer().DbLevelLimits(levelMin, levelMax); //these levels are retrieved and printed on device N95TBuf<50> buffer; buffer = iAudioEqualizerUtility->GetPresetL(nn-1); iBuf = buffer; // this preset is printed correctly on target N95 (= Rock)// used to create a dummy preset name to for testing purpose. _LIT( KHello, "AABBCC" ); TBuf<100> something; something.Copy(KHello);// here I just try to set a value on the fourth equalizer band in order to try to verify if this value is really stored in the device // However, this new band value is NOT stored. Why not????iAudioEqualizerUtility->Equalizer().EnableL(); iAudioEqualizerUtility->Equalizer().SetBandLevelL(4, 11); iAudioEqualizerUtility->Equalizer().ApplyL();//This new equalizer preset name shows upp after creation in the media // player on the N95 device. But the band value I wanted to store did not show upp, why?? iAudioEqualizerUtility->CreatePresetL(something, iAudioEqualizerUtility->Equalizer());}
Note: I apply all capabilities allowed using the demo signing at symbiansigning.com and have set the following capabilities in the .mmp file: ReadDeviceData ReadUserData SwEvent TrustedUI UserEnvironment WriteDeviceData WriteUserData