0
0

Hi
I have a problem with playing 2 wav at the same time
My Sound class

header file :
[code:2zunh8br]
class CFmodSound {
public:
CFmodSound();
~CFmodSound(){
}
FSOUND_SAMPLE *FmodLoader ;
bool CreateFModSound ( char *fsoundfile);
bool FModInitialize () ;
bool FModLoadSound ( char *filename );
GLvoid FModPlaydSound () ; // gram
GLvoid FModStopSound () ; // odtwarzam
GLvoid FModShutDown () ;
};

endif

[/code:2zunh8br]
CPP file :
[code:2zunh8br]
CFmodSound::CFmodSound() {
FmodLoader = NULL;
}
bool CFmodSound::CreateFModSound(char *fsoundfile) {
if (fsoundfile == NULL)
return false;
if (!FModInitialize())
return false;
if (!FModLoadSound(fsoundfile))
return false;
return true ;
}
bool CFmodSound::FModInitialize() {
FSOUND_Init (44100, 32, 0) ;
return true;
}
bool CFmodSound::FModLoadSound(char *filename) {
FmodLoader = FSOUND_Sample_Load (0,filename,0, 0, 0);
return true ;
}
GLvoid CFmodSound::FModPlaydSound() {
GLint vol = FSOUND_PlaySoundEx(FSOUND_FREE, FmodLoader, NULL, false ) ;
FSOUND_SetVolume(vol,Sound_SFX);
}
[/code:2zunh8br]

I use my class :
[code:2zunh8br]
CFmodSound f_MenuSound ;
CFmodSound s_MenuSound ;
[/code:2zunh8br]

[code:2zunh8br]
if (!f_MenuSound.CreateFModSound ("Sound/Misc/DEFAULT_SOUND.wav"))
return false ;
if(!s_MenuSound.CreateFModSound("Sound/Misc/DEFAULT_SOUND_2.wav"))
return false ;

f_MenuSound.FModPlaydSound();
s_MenuSound.FModPlaydSound();
[/code:2zunh8br]

When I start program only s_MenuSound is playing , if I comment the s_MenuSound , f_MenuSound is playing : – (

I thank for help, greeting from Polish

  • You must to post comments
0
0

Hi
Thanks Brett for your help i was change my code
[code:drogjxv8]
bool CFmodSound::FModLoadSound(char *filename) {
FmodLoader = FSOUND_Sample_Load (FSOUND_UNMANAGED,filename,0, 0, 0);
return true ;
}
[/code:drogjxv8]
working perfectly : – )

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.