PDA

Click to See Complete Forum and Search --> : Playing large wav files with Direct Sound


kl899
Jan 5th, 2000, 12:23 PM
I have a 60 meg wav file that I need to play using Direct Sound. All goes well except that it takes 5 minutes for the sound to load. I have 128 megs of ram. My question is how would I make it so that Direct Sound doesn't try loading the entire file at once?
The cooperative level is set to: DSSCL_NORMAL
Then for my buffer description I have:
bufferDesc.lFlags = DSBCAPS_CTRLFREQUENCY Or DSBCAPS_CTRLPAN Or DSBCAPS_CTRLVOLUME Or DSBCAPS_STATIC
This is my code for the creation of the actual buffer:
Set m_dsBuffer(i) = m_ds.CreateSoundBufferFromFile(sfile, bufferDesc, waveFormat)
In the SDK I read that the flag DSBCAPS_STATIC tells Direct Sound to load the entire file into memory so I took it out but it still took 5 minutes for the program to start while the sound was being loaded.

steviep
Jan 5th, 2000, 08:05 PM
You could always use Microsoft MMControl6.0 or MCI32.OCX...This plays it via streaming rather than loading the entire file into memory...

kl899
Jan 6th, 2000, 04:07 AM
Hmm... well I would prefer to do everything in Direct Sound because I need to mix multiple sounds.