0
0

Hi all,

I am new to FMOD and so far am liking it. However I am having a few
problems. I have multiple wav files in my game and after I load them and call PlaySound() they all play at the same time. Here is some of the code

// initialize FMOD
FSOUND_Init(44100, 32, 0);

// load the wav files into memory
PMoveWav = FSOUND_Sample_Load(0, “pmove.wav”,0,0,0);
CMoveWav = FSOUND_Sample_Load(1,”cmove.wav”,0,0,0);
PGridWav = FSOUND_Sample_Load(2,”pgrid.wav”,0,0,0);
CGridWav = FSOUND_Sample_Load(3,”cgrid.wav”,0,0,0);

// play the wav files
FSOUND_PlaySound(0, PMoveWav);

// other section of code
FSOUND_PlaySound(1, CMoveWav);

Each time the individual calls to PlaySound() are called, all the sounds are played at the same time on top of each other. And yes all of the pointer values are different. Any Suggestions?? I am using VC6.

   Thanks..............Jeff
  • You must to post comments
0
0

I tried just loading one sound and playing it and it worked fine.

Let me clarify what is happening.
I have a MFC app and want to load all the wavs in the game in the View class constructor. The FSOUND_SAMPLE pointers are all global in the View class. I have assigned them each an individual channel 0,1,2,3 and an individual name. Then i call each sound with FSOUND_PlaySound() in completely different functions and all of the wavs play at the same time on top of each other.

///////// view class constructor //////////////

// load the wav files into memory
PMoveWav = FSOUND_Sample_Load(0, “pmove.wav”,FSOUND_NORMAL,0,0);
CMoveWav = FSOUND_Sample_Load(1,”cmove.wav”,FSOUND_NORMAL,0,0);
PGridWav = FSOUND_Sample_Load(2,”pgrid.wav”,FSOUND_NORMAL0,0);
CGridWav = FSOUND_Sample_Load(3,”cgrid.wav”,FSOUND_NORMAL,0,0);

// function A
FSOUND_PlaySound(0, PMoveWav);

// function B
FSOUND_PlaySound(1, CMoveWav);

When function A or B is called you can hear both sounds play simultaneously.
I have assigned each wav a seperate channel and name, but the both play in each function. Please help……….

                         Jeff
  • You must to post comments
0
0

Problem solved…………my fault 😮

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.