Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hello everybody,

I have a problem with IMEDIAUTIL_CreateMedia, here is my code:

// create media data
temp = (char*)MALLOC(sizeof(char)*100);
STRCPY(temp, "./sound/modelsound/model.mmf"); // ok with mp3 file
pMe->soundPlayingData.mData.clsData = MMD_FILE_NAME;
pMe->soundPlayingData.mData.pData = (void *)temp;
pMe->soundPlayingData.mData.dwSize = 0;

// create media util
ISHELL_CreateInstance(pMe->pIShell, AEECLSID_MEDIAUTIL, (void**)&pMe->soundPlayingData.MediaUtilCtl);

// create media
i = IMEDIAUTIL_CreateMedia(pMe->soundPlayingData.MediaUtilCtl,&pMe->soundPlayingData.mData,&pMe->soundPlayingData.pIMedia); /* problem here: i returned with value 2036 (MM_ENOMEDIAMEMORY: No memory to create IMedia object)*/

// play sound
IMEDIA_Play(pMe->soundPlayingData.pIMedia);

Please help me! Thank you so much!

And what does the IMEDIAUTIL_CreateMedia() return? Are you sure the pMediaUtil is being created correctly?

And what does the IMEDIAUTIL_CreateMedia() return? Are you sure the pMediaUtil is being created correctly?

Try using
// create media data
temp = (char*)MALLOC(sizeof(char)*100);
STRCPY(temp, "./sound/modelsound/model.mmf"); // ok with mp3 file
pMe->soundPlayingData.mData.clsData = MMD_FILE_NAME;
pMe->soundPlayingData.mData.pData = (void *)temp;
pMe->soundPlayingData.mData.dwSize = 0;
// create media
i = AEEMediaUtil_CreateMedia(pMe->m_pIShell,&pMe->soundPlayingData.mData,&pMe->soundPlayingData.pIMedia);

Try using
// create media data
temp = (char*)MALLOC(sizeof(char)*100);
STRCPY(temp, "./sound/modelsound/model.mmf"); // ok with mp3 file
pMe->soundPlayingData.mData.clsData = MMD_FILE_NAME;
pMe->soundPlayingData.mData.pData = (void *)temp;
pMe->soundPlayingData.mData.dwSize = 0;
// create media
i = AEEMediaUtil_CreateMedia(pMe->m_pIShell,&pMe->soundPlayingData.mData,&pMe->soundPlayingData.pIMedia);

Hi Yuri,
IMEDIAUTIL_CreateMedia() returns 2036 (MM_ENOMEDIAMEMORY: No memory to create IMedia object).
And pMediaUtil is ok.
Thank a lot!

Hi Yuri,
IMEDIAUTIL_CreateMedia() returns 2036 (MM_ENOMEDIAMEMORY: No memory to create IMedia object).
And pMediaUtil is ok.
Thank a lot!

Hi ittekinomizu,
I have tried your code, AEEMediaUtil_CreateMedia returns 0 (SUCCESS) but cannot create pIMedia (pIMedia = 0x00000000 {pvt=???}).
Thank you so much!

Hi ittekinomizu,
I have tried your code, AEEMediaUtil_CreateMedia returns 0 (SUCCESS) but cannot create pIMedia (pIMedia = 0x00000000 {pvt=???}).
Thank you so much!

pls try using
ISHELL_CreateInstance( ... );
IMEDIA_SetMediaData( ... );
IMEDIA_RegisterNotify( ... );
IMEDIA_Play( ... );

pls try using
ISHELL_CreateInstance( ... );
IMEDIA_SetMediaData( ... );
IMEDIA_RegisterNotify( ... );
IMEDIA_Play( ... );

Hi Hoang
pls try using
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_MEDIAMMF, (void**)&pMe->m_pIMedia );
IMEDIA_SetMediaData( pMe->m_pIMedia, &pMe->m_mediaData );
IMEDIA_RegisterNotify( pMe->m_pIMedia, soundNotify, pMe );
IMEDIA_Play( pMe->m_pIMedia );

Hi Hoang
pls try using
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_MEDIAMMF, (void**)&pMe->m_pIMedia );
IMEDIA_SetMediaData( pMe->m_pIMedia, &pMe->m_mediaData );
IMEDIA_RegisterNotify( pMe->m_pIMedia, soundNotify, pMe );
IMEDIA_Play( pMe->m_pIMedia );

Hi ittekinomizu ,
I have tried your code:
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_MEDIAMMF, (void**)&pMe->m_pIMedia ); /* returns 3 (ECLASSNOTSUPPORT: class specified is not supported.) */
IMEDIA_SetMediaData( pMe->m_pIMedia, &pMe->m_mediaData );
IMEDIA_RegisterNotify( pMe->m_pIMedia, soundNotify, pMe );
IMEDIA_Play( pMe->m_pIMedia );
I use Brew 3.1.2 Japanese.
Many thanks to you!

Hi ittekinomizu ,
I have tried your code:
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_MEDIAMMF, (void**)&pMe->m_pIMedia ); /* returns 3 (ECLASSNOTSUPPORT: class specified is not supported.) */
IMEDIA_SetMediaData( pMe->m_pIMedia, &pMe->m_mediaData );
IMEDIA_RegisterNotify( pMe->m_pIMedia, soundNotify, pMe );
IMEDIA_Play( pMe->m_pIMedia );
I use Brew 3.1.2 Japanese.
Many thanks to you!

Hi Hoang
use ISHELL_QueryClass to check if AEECLSID_MEDIAMMF is really supported or not.

Hi Hoang
use ISHELL_QueryClass to check if AEECLSID_MEDIAMMF is really supported or not.

Hello ittekinomizu,
Thank ittekinomizu, AEECLSID_MEDIAMMF is not supported!

Hello ittekinomizu,
Thank ittekinomizu, AEECLSID_MEDIAMMF is not supported!

Hi Hoang,
if you download ma3smwemu.dll then copy the downloaded files to $BREWDIR\bin\Modules, everything will be ok.
you can download the file at:
http://wipi.wisegram.com/bbs/view.php?id=wipiqa&page=1&sn1=&divpage=1&sn...

Hi Hoang,
if you download ma3smwemu.dll then copy the downloaded files to $BREWDIR\bin\Modules, everything will be ok.
you can download the file at:
http://wipi.wisegram.com/bbs/view.php?id=wipiqa&page=1&sn1=&divpage=1&sn...

Thank ittekinomizu so much but I cannot play mmf file.
b = ISHELL_QueryClass(pMe->pIShell,AEECLSID_MEDIAMMF,NULL); // return 0 (FALSE: class not supported.)
i = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_MEDIAMMF,(void **)&pMe->soundPlayingData.pIMedia); // return 3 (ECLASSNOTSUPPORT: class specified is not supported.)
It is still the same before I copy ma3smwemu.dll to ...\BREW 3.1.2 Ja\sdk\bin\Modules. Must I do anything else?

Thank ittekinomizu so much but I cannot play mmf file.
b = ISHELL_QueryClass(pMe->pIShell,AEECLSID_MEDIAMMF,NULL); // return 0 (FALSE: class not supported.)
i = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_MEDIAMMF,(void **)&pMe->soundPlayingData.pIMedia); // return 3 (ECLASSNOTSUPPORT: class specified is not supported.)
It is still the same before I copy ma3smwemu.dll to ...\BREW 3.1.2 Ja\sdk\bin\Modules. Must I do anything else?

Hi Hoang,
Play .mmf files with BREW 3.1.4.

Hi Hoang,
Play .mmf files with BREW 3.1.4.

Hi ittekinomizu,
Cannot play mmf file with Brew 3.1.2 Japanese?

Hi ittekinomizu,
Cannot play mmf file with Brew 3.1.2 Japanese?

Hi Hoang,
I can play .mmf files with BREW 3.1.4 but can't with BREW 3.1.2. I don't know the reason yet.

Hi Hoang,
I can play .mmf files with BREW 3.1.4 but can't with BREW 3.1.2. I don't know the reason yet.

Hi ittekinomizu,
I try with Brew 3.1.4, but still be failed:
i = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_MEDIAMMF,(void **)&pMe->soundPlayingData.pIMedia);
IMEDIA_SetMediaData(pMe->soundPlayingData.pIMedia, &pMe->soundPlayingData.mData);
i = IMEDIA_RegisterNotify(pMe->soundPlayingData.pIMedia, soundNotify, pMe); // ok
i = IMEDIA_Play(pMe->soundPlayingData.pIMedia); // returns 6 - EUNABLETOLOAD: Unable to load object/applet
Do you know that error?

Hi ittekinomizu,
I try with Brew 3.1.4, but still be failed:
i = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_MEDIAMMF,(void **)&pMe->soundPlayingData.pIMedia);
IMEDIA_SetMediaData(pMe->soundPlayingData.pIMedia, &pMe->soundPlayingData.mData);
i = IMEDIA_RegisterNotify(pMe->soundPlayingData.pIMedia, soundNotify, pMe); // ok
i = IMEDIA_Play(pMe->soundPlayingData.pIMedia); // returns 6 - EUNABLETOLOAD: Unable to load object/applet
Do you know that error?

Hi ittekinomizu,
I try with Brew 3.1.4, but still be failed:
i = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_MEDIAMMF,(void **)&pMe->soundPlayingData.pIMedia);
IMEDIA_SetMediaData(pMe->soundPlayingData.pIMedia, &pMe->soundPlayingData.mData);
i = IMEDIA_RegisterNotify(pMe->soundPlayingData.pIMedia, soundNotify, pMe); // ok
i = IMEDIA_Play(pMe->soundPlayingData.pIMedia); // returns 6 - EUNABLETOLOAD: Unable to load object/applet
Do you know that error?

Hi ittekinomizu,
I try with Brew 3.1.4, but still be failed:
i = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_MEDIAMMF,(void **)&pMe->soundPlayingData.pIMedia);
IMEDIA_SetMediaData(pMe->soundPlayingData.pIMedia, &pMe->soundPlayingData.mData);
i = IMEDIA_RegisterNotify(pMe->soundPlayingData.pIMedia, soundNotify, pMe); // ok
i = IMEDIA_Play(pMe->soundPlayingData.pIMedia); // returns 6 - EUNABLETOLOAD: Unable to load object/applet
Do you know that error?

Hi Hoang,
check
// create media data
STRCPY(temp, "./sound/modelsound/model.mmf"); // ok with mp3 file
again. if you still fail, refer to mediaplayer example.

Hi Hoang,
check
// create media data
STRCPY(temp, "./sound/modelsound/model.mmf"); // ok with mp3 file
again. if you still fail, refer to mediaplayer example.

Hi ittekinomizu,
I found out what the problem is. That is due to my mmf file. It will play well with example mmf file downloaded.
One more time, thank you very much!

Hi ittekinomizu,
I found out what the problem is. That is due to my mmf file. It will play well with example mmf file downloaded.
One more time, thank you very much!