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

Developer

Forums

Forums:

I AM A NEWBIE,AND

I tried to porting a game to handset SCH-E239, WHEN I LOAD THE SOUND RESOURCES I MET A PROBLEM LIKE THIS:

/////////////////////////////////////////////////////////////////////////////////////////////////

GmodeSound *GmodeSystem_LoadResourceSound(GmodeSystem *pSystem, const char *file, int16 id)
{
GmodeSound *sound;
uint32 size, offset;
int i;

// サウンドの空きを取得,ENTRY WAS DEFINED AS INT 18
for (i = 0; i < SOUND_ENTRY; i++) {
if (pSystem->sounds[i].pMedia == NULL && pSystem->sounds[i].data == NULL) {
break;
}
}
if (i >= SOUND_ENTRY) {
return NULL;
}
sound = &pSystem->sounds[i];

// イメージとしてリソースに登録されたサウンドデータを読み込む
ISHELL_LoadResDataEx(pSystem->applet.m_pIShell, file, id, RESTYPE_IMAGE, (void *)-1, &size);
sound->data = ISHELL_LoadResData(pSystem->applet.m_pIShell, file, id, RESTYPE_IMAGE);
if (sound->data == NULL) {
return NULL;
}

// メディアデータの設定
offset = *(unsigned char *)sound->data;
sound->md.clsData = MMD_BUFFER;
sound->md.pData = (unsigned char *)sound->data + offset;
sound->md.dwSize = size - offset;

// インスタンスの生成
if (ISHELL_CreateInstance(pSystem->applet.m_pIShell, AEECLSID_MEDIAPHR, (void **)&sound->pMedia) != SUCCESS) {
ISHELL_FreeResData(pSystem->applet.m_pIShell, sound->data);
sound->data = NULL;
return NULL;
}

// 再生準備/A5304T が MM_PARM_PLAY_REPEAT 非対応なので、デフォルト1回再生に依存
// IMEDIA_SetMediaParm(sound->pMedia, MM_PARM_PLAY_REPEAT, 1, 0);
IMEDIA_SetMediaData(sound->pMedia, &sound->md);

// コールバック関数の設定
IMEDIA_RegisterNotify(sound->pMedia, (PFNMEDIANOTIFY)GmodeSystem_CallBackNotifySound, sound);

// 解放中フラグの設定
sound->release = FALSE;

// 終了
return sound;

//////////////////////////////////////////////////////////////////////////////////////////////

ERROR RETURNED AT STATEMENT:

if (ISHELL_CreateInstance(pSystem->applet.m_pIShell, AEECLSID_MEDIAPHR, (void **)&sound->pMedia) != SUCCESS) {

THE RETURN MESSEGE WAS :UNSUPORTEDCLASS, ISN,T SCH-E239 HANDSET SURPORT AEECLSID_MEDIAPHR INTERFACE?

AND HOW COULD I MODIFY MY CODES? THX A LOT!

it may be that AEECLSID_MEDIAPHR is not supported. What is the type of audio you want to play from resource.
OR
Only One Type the can set to the Imedia.

it may be that AEECLSID_MEDIAPHR is not supported. What is the type of audio you want to play from resource.
OR
Only One Type the can set to the Imedia.

You should use the following function for creation of a media type:
int IMEDIAUTIL_CreateMedia ( IMediaUtil * pIMediaUtil, AEEMediaData * pmd, IMedia ** ppm )
but if a device is returning EUNSUPPORTED, then the class is unsupported.

You should use the following function for creation of a media type:
int IMEDIAUTIL_CreateMedia ( IMediaUtil * pIMediaUtil, AEEMediaData * pmd, IMedia ** ppm )
but if a device is returning EUNSUPPORTED, then the class is unsupported.

i want to play .mmf from my resources

i want to play .mmf from my resources

Did you tried with "AEECLSID_MEDIAMMF"

Did you tried with "AEECLSID_MEDIAMMF"

skumar_rao wrote:Did you tried with "AEECLSID_MEDIAMMF"
No, you should use the following:
IMEDIAUTIL_CreateMedia ( IMediaUtil * pIMediaUtil, AEEMediaData * pmd, IMedia ** ppm )
This is the recommended method of media creation. This call can be used for any media type, and will always use the "best" interface for the specified type.

skumar_rao wrote:Did you tried with "AEECLSID_MEDIAMMF"
No, you should use the following:
IMEDIAUTIL_CreateMedia ( IMediaUtil * pIMediaUtil, AEEMediaData * pmd, IMedia ** ppm )
This is the recommended method of media creation. This call can be used for any media type, and will always use the "best" interface for the specified type.