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

Developer

Forums

Forums:

Hi, all,

I have this program that plays MMF files as SDT_BUFFER. Now, I want to change the program to play MIDI files as SDT_BUFFER. How do I do that? Any specific changes I need to make? I don't have a lot of experience working with sound. Any help would be appreciated.

Thank you.

Are you seeing any problems? ISoundPlayer should be format-agnostic.

Are you seeing any problems? ISoundPlayer should be format-agnostic.

mohlendo wrote:Are you seeing any problems? ISoundPlayer should be format-agnostic.
I want to load MIDI file into a buffer. I first load it from the RES.:
void CGameMoon::LoadSound()
{
byte* pRes= NULL;
byte* pData= NULL;
int sizeSnd= 0;
for (int i=0; i
Then, I call playSound.
void CGameMoon::PlaySound(uint16 sound_res)
{
if (sound_res < IDS_MGO || sound_res >= IDS_MGO +N_SOUNDP) return;
if (m_pISoundPlayer==NULL)
{
if (GetISoundPlayer())
ISOUNDPLAYER_RegisterNotify(m_pISoundPlayer, &SoundPlayerCBFn, (void *)this);
}
if (m_pISoundPlayer)
{
wLastSound= sound_res;
if (bSoundPlay)
StopSound(sound_res);
if (bSoundPlay == 0)
{
//#ifndef AEE_SIMULATOR
int idx= sound_res -IDS_MGO;
if (lpSound[idx])
{
byte* lpMIDI = lpSound[idx];
int sizeSnd= GET_MIDISIZE(lpMIDI);
lpSoundBuf= MALLOC(sizeSnd);
MEMCPY(lpSoundBuf, lpMIDI, sizeSnd);
ISOUNDPLAYER_Set(m_pISoundPlayer, SDT_FILE, lpSoundBuf);
ISOUNDPLAYER_Play(m_pISoundPlayer);
bSoundPlay= 1;
}
}
}

But, I don't hear any sound. What can be the problem?
Thank you.

mohlendo wrote:Are you seeing any problems? ISoundPlayer should be format-agnostic.
I want to load MIDI file into a buffer. I first load it from the RES.:
void CGameMoon::LoadSound()
{
byte* pRes= NULL;
byte* pData= NULL;
int sizeSnd= 0;
for (int i=0; i
Then, I call playSound.
void CGameMoon::PlaySound(uint16 sound_res)
{
if (sound_res < IDS_MGO || sound_res >= IDS_MGO +N_SOUNDP) return;
if (m_pISoundPlayer==NULL)
{
if (GetISoundPlayer())
ISOUNDPLAYER_RegisterNotify(m_pISoundPlayer, &SoundPlayerCBFn, (void *)this);
}
if (m_pISoundPlayer)
{
wLastSound= sound_res;
if (bSoundPlay)
StopSound(sound_res);
if (bSoundPlay == 0)
{
//#ifndef AEE_SIMULATOR
int idx= sound_res -IDS_MGO;
if (lpSound[idx])
{
byte* lpMIDI = lpSound[idx];
int sizeSnd= GET_MIDISIZE(lpMIDI);
lpSoundBuf= MALLOC(sizeSnd);
MEMCPY(lpSoundBuf, lpMIDI, sizeSnd);
ISOUNDPLAYER_Set(m_pISoundPlayer, SDT_FILE, lpSoundBuf);
ISOUNDPLAYER_Play(m_pISoundPlayer);
bSoundPlay= 1;
}
}
}

But, I don't hear any sound. What can be the problem?
Thank you.

Anybody with experience of sound file conversion?

Anybody with experience of sound file conversion?