Results 1 to 2 of 2

Thread: 10 tons of questions

  1. #1

    10 tons of questions

    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:

    Code:
    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);
    waves.Add(wave);
    
    SoundManager.CreateFromMemory(SoundBuffer, wave.WaveFile.m_pbData, wave.WaveFile.m_dwSize, wave.WaveFile.GetFormat, 0, GUID_NULL, 1 );
    Buffers.Add(SoundBuffer);
    SoundBuffer.Play(0,0,0,-1,0);
    No sound is played, everything compiles ok.

  2. #2

    10 tons of questions

    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.
    There are only 10 types of people in this world; those who understand binary and those who don't.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •