Original Post
Hi,
I created a soundbuffer wrapper for DirectSound that is able to load a wave file and keep it in a number of soundbuffers (for simultaneous playback of the same sample). On loading a wave file it takes the DirectSound interface object as a parameter. Now here is the problem: it works fine with loading ONE sample this way (in any number of copies), however when I create another wavewrapper object it fails while trying to load the sample. If you can find any explanation of this please tell me what I'm doing wrong.
http://www.moviecodec.com/cpp/wavewrapper.cpp
http://www.moviecodec.com/cpp/wavewrapper.h
(The function to load a wave file into sound buffer comes from André LaMothes "trick of the windows game programming gurus").
When creaing object this works:
explosionWave1 = new WaveWrapper();
if (!explosionWave1->LoadWAVE("wav\\EXP0.WAV",NUM_XPLO_FX_CHAN,myDSInterface))
FatalError("Error LoadWAVE");
and this works:
fireWave1 = new WaveWrapper();
if (!fireWave1->LoadWAVE("wav\\11kcannon.wav",NUM_FIRE_FX_CHAN,myDSInterface))
FatalError("Error LoadWAVE");
BUT this does NOT work:
explosionWave1 = new WaveWrapper();
if (!explosionWave1->LoadWAVE("wav\\EXP0.WAV",NUM_XPLO_FX_CHAN,myDSInterface))
FatalError("Error LoadWAVE");
fireWave1 = new WaveWrapper();
if (!fireWave1->LoadWAVE("wav\\11kcannon.wav",NUM_FIRE_FX_CHAN,myDSInterface))
FatalError("Error LoadWAVE");
Weird
[edited by - beowulf on October 2, 2002 6:27:18 AM]