how to play streaming MP3 smoothly? | developer.brewmp.com how to play streaming MP3 smoothly? | developer.brewmp.com

Developer

how to play streaming MP3 smoothly?

Forums:

Hi all,
I am trying to play a streaming MP3 file.
Currently, the sound data is loadded by using IFILE_Read method.
It plays sound correctly.
But there exists sound gap when I want to play next buffer.
Even I just repeat the same buffer loadded first time, the situation is the same.
So I think that maybe IMEDIA_Play API will take a while to do some init actions(For example: decode MP3 format sound data).
Any one get solution?

I try different play method by setting clsData as MMD_ISOURCE type and fit ISource data.
But It's can't play normally, I don't know why.

The following is my code snippet.

// Read data
...
IFile *pf = FMR_FileOpen( app->m_pFileMgr, "res/test.mp3", _OFM_READ );
int size = IFILE_Read(pf, app->m_pStreamingInfo->m_pBuf, GLOBAL_BUF_SIZE);
...
...

...
...
// Set data source
AEEMediaData ad;
ad.clsData = MMD_BUFFER;
ad.pData = (void *)buffer;
ad.dwSize = dwSize;

int retCode = IMEDIA_SetMediaData( pPlayer, &ad );
if ( retCode == SUCCESS ) {
pInfo->m_bPlaying = TRUE;
// Set the notification callback
IMEDIA_RegisterNotify( pPlayer, streamingNotifyCallBack, pInfo );
// Start the playback
IMEDIA_Play( pPlayer );
IMEDIA_SetVolume( pPlayer, 100 );
}
...
...

...
...
// play next segment
case MM_STATUS_DONE:
{
// play sound
IMEDIA_RegisterNotify( pInfo->m_pPlayer, streamingNotifyCallBack, pInfo );
IMEDIA_Play( pInfo->m_pPlayer );

break;

hi,
Had u have any success in this matter..? Could u play an MP3 file in the handset using the MMD_BUFFER type ? Pls let us know ur experiments with playing Audio buffer in a continuous way.
CoolB

hi,
Had u have any success in this matter..? Could u play an MP3 file in the handset using the MMD_BUFFER type ? Pls let us know ur experiments with playing Audio buffer in a continuous way.
CoolB

Try not re-registering the callback.

Try not re-registering the callback.

Hi Sunil!
I also faced the same problem , playing with buffer , i did not re-registerd in the callback, i simply called IMEDIA_play(), but it i faced same pause between every two consictive plays. Is there any other solution ?
this is my original post : http://brewforums.qualcomm.com/showthread.php?t=12190
thanx alot
amaranth

Hi Sunil!
I also faced the same problem , playing with buffer , i did not re-registerd in the callback, i simply called IMEDIA_play(), but it i faced same pause between every two consictive plays. Is there any other solution ?
this is my original post : http://brewforums.qualcomm.com/showthread.php?t=12190
thanx alot
amaranth

We are facing the same situation here. We thought, at first, that it was due to the mp3 format not being "native" to the platform. So we went with pure voice; no imporvements there. One thing you will notice is that ISource will pull the requested file completely before we can do anything with it. So, for streaming this may be a major hurdle. Has anyone solved this, a hint would be good, no code needed.
Saludos,

We are facing the same situation here. We thought, at first, that it was due to the mp3 format not being "native" to the platform. So we went with pure voice; no imporvements there. One thing you will notice is that ISource will pull the requested file completely before we can do anything with it. So, for streaming this may be a major hurdle. Has anyone solved this, a hint would be good, no code needed.
Saludos,

This problem is there on BREW for a long time. I remember we had faced this problem and tried almost everything. The last thing that we did was get support from Qualcomm which said that nothing can be done for this and there will be a pause when a mp3 is repeatedly played.

This problem is there on BREW for a long time. I remember we had faced this problem and tried almost everything. The last thing that we did was get support from Qualcomm which said that nothing can be done for this and there will be a pause when a mp3 is repeatedly played.