View Full Version : 10 tons of questions

09-11-2003, 04:13 AM
Question about the "SoundManager.Create". Every time this is called, is it loading it off disk? That would seem pretty inefficient. So I?_Tm added some cwavefile?_Ts, load all the sounds I?_Tm going to use, then tried to use SoundManager.CreateFromMemory. That didn?_Tt work out so well. The really short version looked like:

wave := tWave.Create;
wave.name := filename;
wave.WaveFile := cWaveFile.Create;
wave.WaveFile.Open(pAnsiChar(filename), nil, WAVEFILE_READ);
wave.WaveFile.Read(wave.WaveFile.m_pbData, wave.WaveFile.GetSize, pdwSizeRead);

SoundManager.CreateFromMemory(SoundBuffer, wave.WaveFile.m_pbData, wave.WaveFile.m_dwSize, wave.WaveFile.GetFormat, 0, GUID_NULL, 1 );

No sound is played, everything compiles ok.

09-11-2003, 02:07 PM
Hm... Seems you've found bug in DirectSound framework (have to log it to MS).
Mail me privately and I'll send you updated DSUtil.pas file which allowed me to play sound using memory pointer. If you'll find it's working correclty I'll publish it.