Trouble with ISOUND | developer.brewmp.com Trouble with ISOUND | developer.brewmp.com

Developer

Trouble with ISOUND

Forums:

I'm new to using BREW, and i have been struggling with the ISound & and IMedia interface trying to get some audio to play, I'm using the ISound right now, but i keep getting compile errors. I think i have some incorrect pointers, could somebody take a look and help me out.

" error C2039: 'm_pISoundPlayer' : is not a member of '_defender' "
is one of the reoccuring errors.

-------------------------------------------------------
static boolean defender_HandleEvent(defender* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{

AECHAR szBuf[100] = {0};
AEESoundPlayerInput input = {0};

input = SDT_FILE;
switch (eCode)
{

// App is told it is starting up
case EVT_APP_START:

pMe->gameMode=GAME_MODE_NONE;
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
ShowSplash(pMe);
ISHELL_SetTimer(pMe->a.m_pIShell, 1500, (PFNNOTIFY) defender_BuidMainMenu, (uint32*) pMe);
IDISPLAY_Update(pMe->pIDisplay);
// Add your code here...
SHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_SOUNDPLAYER, (void **)m_pISoundPlayer);
ISOUNDPLAYER_Set(pMe->m_pISoundPlayer, SDT_FILE, "canyon.mid");

ISOUNDPLAYER_RegisterNotify(pMe->m_pISoundPlayer, &SoundPlayerCBFn, pMe);

ISOUNDPLAYER_Play (pMe->m_pISoundPlayer);
return(TRUE);

Hi,
U r using ISound or ISoundPlayer, wat type of pointer is 'm_pISoundPlayer' , it seems u rusing mixup of ISound & ISoundPlayer.

Hi,
U r using ISound or ISoundPlayer, wat type of pointer is 'm_pISoundPlayer' , it seems u rusing mixup of ISound & ISoundPlayer.

I think problem is with this statment
Quote:ISOUNDPLAYER_Set(pMe->m_pISoundPlayer, SDT_FILE, "canyon.mid");
Third argument should be file pointer or buffer pointer but not file name,
Open file with IFile interface and try, it should work...

I think problem is with this statment
Quote:ISOUNDPLAYER_Set(pMe->m_pISoundPlayer, SDT_FILE, "canyon.mid");
Third argument should be file pointer or buffer pointer but not file name,
Open file with IFile interface and try, it should work...