I am trying to develop a cleint/server application, using bluetooth.
And the server (computer) sends some audio data to the client (nokia 7650).
I can receive the audio data successfully, I checked the size and so on...
But impossible to play the audio data, it crashes in the MapcInitComplete function with the KErrNotSupported error (-5).
I thought it could be the format of the audio data (WAV and AMR), but if I load the file with the application and open the file (NewFilePlayerL()), it plays my audio sample well.
So I am out of ideas now, and I need your help ;)
Here some of my code from my AppUI.cpp, when it receives some data from the server :
TDes8* iDes;
iDes = new(ELeave) TBuf8<10000>;
iDes->Zero();
//buffer contains the data I received from the server via bluetooth
for (TInt i=0;i<buffer.Length();i++)
{
iDes->Append(buffer[i]);
}
iPlayerAdapter = CPlayerAdapter::NewL(*iDes, *this);
SetAdapterL(iPlayerAdapter);
And here is the implementation of playeradapter.cpp:
void CPlayerAdapter::ConstructL(TDes8& aDes
{
iMdaAudioPlayerUtility = CMdaAudioPlayerUtility::NewDesPlayerL(aDes, *this);
}
void CPlayerAdapter::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
{
iState = aError ? ENotReady : EReadyToPlay;
if (!aError)
iMdaAudioPlayerUtility->Play();
else
//I display the message error here : KErrNotSupported -5
}
What is wrong in my code? Do i need some flush or something like that?
Thanks in advance!
Sihem
Re: CMdaAudioPlayerUtility::NewDesPlayerL(...); tells me KErrNotSupported
2011-01-31, 11:32#2
Talking about "same" in a 6.5 years old thread is always a bit confusing... If you are really using the same device, note that S60 devices do not support .mp3 prior to S60 2nd edition Feature Pack 1.
Re: CMdaAudioPlayerUtility::NewDesPlayerL(...); tells me KErrNotSupported
2011-02-10, 10:59#4
A sanity check could be testing if the device is able to play that file at all. Copy the file to some public location (like the memory card), and try to play it from the File Manager.