Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. DirectSound & Certain WAV Files

DirectSound & Certain WAV Files

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearningc++graphicsgame-dev
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 2391
    wrote on last edited by
    #1

    I am learning how to use DirectX from a book (SAMS Teach Yourself DirectX 7 In 24 Hours - although it received some negative reviews, on the whole I think it is pretty good). I have got some DirectSound code working, but only on certain WAV files. The WAV files that work properly have 8 as the wBitsPerSample member of the WAVEFORMATEX structure. The ones that don't have 0 as this value (what actually happens is that the sound plays as fast as it can go, rather than using the frequency it should be played at). In the VC++ docs (VC++ 6) it says that that member CAN be 0 if the format is not PCM, as sometimes this member can't be used in the compression algorithm the WAV uses. I also notice that the cbSize member can indicate that the WAVEFORMATEX structure has some extra bytes tacked onto the end, so I duly coded to allow for this and passed the extended structure to CreateSoundBuffer(). Although it didn't cause a crash, it made no difference whatsoever. Does anyone know if I am doing something wrong? How can I overcome this problem? According to the book DirectSound can handle ANY format...

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups