Hi,
I am novice to Symbian development. I want to play sound file after 'Play' option selected. but it is not Playing.. I am using PlayUtility.cpp Can anybody help me..I am ready to show my code also..
Hi,
I am novice to Symbian development. I want to play sound file after 'Play' option selected. but it is not Playing.. I am using PlayUtility.cpp Can anybody help me..I am ready to show my code also..
Last edited by amitgawali; 2010-03-27 at 04:55.
basically you could try out the wiki examples, and then do check with debugging on what is happening when your code is executed.
Actually while debugging my application it goes like this once initialization of player,i call MapCInitcomplete in this way
void CPlayerContainer::PlayFile()
{
_LIT(aFileName,"E:\\ding.wav");
iPlayerUtility=CPlayerUtility::NewL(aFileName);//Player initialization
iPlayerUtility->MapcInitComplete(0,TTimeIntervalMicroSeconds());
}
the control goes well over this code to MapcInitComplete the code for MapcInitComplete is:
void CPlayerUtility::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
{
if(aError == KErrNone)
{
iPrepared = ETrue;
iPlayUtility->SetVolume(iPlayUtility->MaxVolume());
//play the file immediately
iPlayUtility->Play();
}
}
problem arises when I reach this line iPlayUtility->SetVolume(iPlayUtility->MaxVolume()); so I decided to add these two functions implemetation as they are declared virtual,bt didnt work out too:
TInt CPlayerUtility::MaxVolume()
{
return 10;
}
void CPlayerUtility::SetVolume(TInt aVolume)
{
aVolume=MaxVolume();
}
Note that MapcInitComplete is a callback, which is going to be called by the 'OS', when your ding.wav is really ready to play. That volume thing sets a variable of yours to some value. It might make sense, but probably it does not.
For a compressed example see #3 of http://discussion.forum.nokia.com/fo...d.php?t=125891