I did my effect engine, build succesfull but effect doesn't run. I am sending you my program can you examine my mistake? Thank you very much.
I can post my project completely if you want.
Best Regards.
There are a few points that are not clear to me after going through the code.
The pointer iMAudioEffectObserver and iAudioEffect are not initialized and used in the code.
The effects have to be created by calling their "NewL()" methods and not by inheriting them.
Now the effects are instantiated by passing to them an instance of CMdaAudioPlayerUtility.
Very very Thanks.
You are genius.
At least effects were worked. I guess N73 is not support BassBoost effect,because when i activate bassboost effect, it seem a notification "Feature Not supported" ,
but loudness and stereowidening effects are OKEY.
I tried it in my N80 phone. I scceeded calling CAudioEqulizatoin::NewL(), CAudioEqulization::NumberOfBands() and CAudioEqulization::DbLevelLimits(). However, when I called CAudioEqulization::BandLevel() or CAudioEqulization::SetBandLevelL(), it leaved and my app exit.
Could you please help me check the following code:
The band number starts from "1" to "max_bands" (normal people's counting).
Just change the counting method i.e; from developer's counting to normal counting.
for (TInt i = 1; i <= bandNum; i++) { iAudioEqualizer->SetBandLevelL(i, levelMin + (levelMax-levelMin)/2); iAudioEqualizer->ApplyL(); TRACEF(CMyLog::VA(_L("SetBandLevel: %i"), iAudioEqualizer->BandLevel(i))); }
I also try to use CAudioEqualizer in my code.
Some different is that I use function
"static IMPORT_C CAudioEqualizer * NewL (CMdaAudioOutputStream &aUtility)"
to create it, instead of
"static IMPORT_C CAudioEqualizer * NewL (CMdaAudioPlayerUtility &aUtility) ".
But I failed to created it on real phone E60 and N73, and the error code is -5, "KErrNotSupported".
Forum posts: 95
Hi,
You can create the instance of the desired effect with appropriate call of NewL().
CMdaAudioPlayerUtility* iPlayer = CMdaAudioPlayer::NewFilePlayer(<parameters>);
//Creating the effect
TRAPD(err,CLoudness* iLoudness = CLoudness::NewL(iPlayer,ETrue /*Enable this effect*/ ));
if(err != KErrNone)
{
//Handle error
}
iLoudness->RegisterObserver(*iMAudioEffectObserver);// Observer inherits "MAudioEffectObserver".
iLoudness->EnforceL(ETrue); //This is required only if the effect is mandatory.
//Applying the effect settings. Enable before applying...
TRAP(err,iLoudness->EnableL());
//Handle error
TRAP(err,iLoudness->ApplyL());
//Handle error
//When done Disable the effect
TRAP(err,iLoudness->DisableL());
iLoudness->UnregisterObserver(iMAudioEffectObserver);
delete iLoudness;
For more information you can refer to Effects API Specification Document.
Hope it helps
Chao,
Ravi
Chao,
Raghav
Forum posts: 5
Thank you very much. I will try as soon as possible.
Best Regards.
Forum posts: 5
I did my effect engine, build succesfull but effect doesn't run. I am sending you my program can you examine my mistake? Thank you very much.
I can post my project completely if you want.
Best Regards.
Forum posts: 95
Hi Cevy,
There are a few points that are not clear to me after going through the code.
The pointer iMAudioEffectObserver and iAudioEffect are not initialized and used in the code.
The effects have to be created by calling their "NewL()" methods and not by inheriting them.
Now the effects are instantiated by passing to them an instance of CMdaAudioPlayerUtility.
The modified files are attached here with.
Best of luck and let us know about the result.
Chao,
Ravi
Chao,
Raghav
Forum posts: 5
Very very Thanks.
You are genius.
At least effects were worked. I guess N73 is not support BassBoost effect,because when i activate bassboost effect, it seem a notification "Feature Not supported" ,
but loudness and stereowidening effects are OKEY.
Very Very Thanks You for BIG HELPING.
Best Regards.
Forum posts: 3
Did you try CAudioEqulization effect in N73?
I tried it in my N80 phone. I scceeded calling CAudioEqulizatoin::NewL(), CAudioEqulization::NumberOfBands() and CAudioEqulization::DbLevelLimits(). However, when I called CAudioEqulization::BandLevel() or CAudioEqulization::SetBandLevelL(), it leaved and my app exit.
Could you please help me check the following code:
void CEQController::ConstructL(CMdaAudioPlayerUtility* aPlayer)
{
iAudioEqualizer = CAudioEqualizer::NewL(*aPlayer, EFalse);
TRACEF(CMyLog::VA(_L("ConstructL iAudioEqualizer: %x"), iAudioEqualizer));
iAudioEqualizer->RegisterObserverL(*this);
TRACEF(CMyLog::VA(_L("RegisterObserverL")));
iAudioEqualizer->EnableL();
TInt bandNum;
TInt32 levelMin, levelMax;
bandNum = iAudioEqualizer->NumberOfBands();
iAudioEqualizer->DbLevelLimits(levelMin, levelMax);
TRACEF(CMyLog::VA(_L("bandNum: %i, levelMin: %i, levelMax, %i"), bandNum, levelMin, levelMax));
for (TInt i = 0; i < bandNum; i++)
{
iAudioEqualizer->SetBandLevelL(i, levelMin + (levelMax-levelMin)/2);
iAudioEqualizer->ApplyL();
TRACEF(CMyLog::VA(_L("SetBandLevel: %i"), iAudioEqualizer->BandLevel(i)));
}
}
Forum posts: 95
Hi,
The band number starts from "1" to "max_bands" (normal people's counting).
Just change the counting method i.e; from developer's counting to normal counting.
for (TInt i = 1; i <= bandNum; i++){
iAudioEqualizer->SetBandLevelL(i, levelMin + (levelMax-levelMin)/2);
iAudioEqualizer->ApplyL();
TRACEF(CMyLog::VA(_L("SetBandLevel: %i"), iAudioEqualizer->BandLevel(i)));
}
Please do update us about the result.
Chao,
Raghav
Forum posts: 3
Raghav,
Thank you very much. Your hint really avoid the leave which has been puzzling me for several weeks.
Code snippet:
TInt CEQEffector::ApplyEQ(TInt aIdx)
{
TInt8 i;
TInt Level, bandNum = NumberOfBands();
TInt32 LevelMax, LevelMin;
DbLevelLimits(LevelMin, LevelMax);
TRACEF(CMyLog::VA(_L("EQ band: %i level: %i, %i"), bandNum, LevelMin, LevelMax));
iAudioEqualizer->EnableL();
for(i = 1; i <= bandNum; i++)
{
iAudioEqualizer->SetBandLevelL(i, 0);
TRACEF(CMyLog::VA(_L("EQ set level: %i, %i"), i, LevelMin + i*(LevelMax-LevelMin)/bandNum));
iAudioEqualizer->ApplyL();
Level = iAudioEqualizer->BandLevel(i);
TRACEF(CMyLog::VA(_L("EQ band level: %i, %i"), i, Level));
}
}
Log:
22:11:33 EQ band: 5 level: -600, 600
22:21:33 EQ set level: 1, -360
22:21:33 EQ band level: 1, -360
22:21:33 EQ set level: 2, -120
22:21:33 EQ band level: 2, -120
22:21:33 EQ set level: 3, 120
22:21:33 EQ band level: 3, 120
22:21:33 EQ set level: 4, 360
22:21:33 EQ band level: 4, 360
22:21:33 EQ set level: 5, 600
22:21:33 EQ band level: 5, 600
Forum posts: 2
Hi,
I also try to use CAudioEqualizer in my code.
Some different is that I use function
"static IMPORT_C CAudioEqualizer * NewL (CMdaAudioOutputStream &aUtility)"
to create it, instead of
"static IMPORT_C CAudioEqualizer * NewL (CMdaAudioPlayerUtility &aUtility) ".
But I failed to created it on real phone E60 and N73, and the error code is -5, "KErrNotSupported".
Please help.
Thanks in advance.
Code snippet:
In class CAudioEngine:
void CAudioEngine::PlayL(){
iAudioStreamPlayer = CMdaAudioOutputStream::NewL(*this);
iAudioStreamPlayer -> Open(&iSettings);
iEQController = CEQController::NewL(*iAudioStreamPlayer);
......
}
(I also try to create iEQController in function "void CAudioEngine::MaoscOpenComplete" and other places, but all failed)
in Class CEQController:
class CEQController : public CBase, MAudioEqualizerObserver
{
public: // Constructors and destructor
~CEQController();
static CEQController* NewL(CMdaAudioOutputStream &aUtility);
static CEQController* NewLC(CMdaAudioOutputStream &aUtility);
public: //
// Set Audio Equalizer
TBool SetEqualizer(TUint8 aMode);
protected:
// From base class: MAudioEqualizerObserver
void EffectChanged (const CAudioEffect *aObservedEffect, TUint8 aEvent);
private:
CEQController();
void ConstructL(CMdaAudioOutputStream &aUtility);
private: // Data
CAudioEqualizer* iAudioEQ;
......
};
void CEQController::ConstructL(CMdaAudioOutputStream &aUtility){
TRAPD( err, iAudioEQ = CAudioEqualizer::NewL(aUtility) );
if (err != KErrNone)
{
// On E60 and N73, Here reported err = -5, KErrNotSupported
}
else
{
iAudioEQ->RegisterObserverL(*this);
//TRAP( err, iAudioEQ->EnableL() );
iNumOfBands = iAudioEQ->NumberOfBands();
iAudioEQ->DbLevelLimits(iDbLevelMin, iDbLevelMax);
}
}