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 buffers

DirectSound buffers

Scheduled Pinned Locked Moved C / C++ / MFC
game-devquestion
4 Posts 2 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.
  • H Offline
    H Offline
    Hanan888
    wrote on last edited by
    #1

    Does it seem reasonable to load a 40-sec WAV to a 'static' DirectSound secondary buffer to play as my game background-music ? If not, why not ? The other option, AFAIK, is having 'streaming' buffer for that. Which will be more complicated programmatically.

    M 1 Reply Last reply
    0
    • H Hanan888

      Does it seem reasonable to load a 40-sec WAV to a 'static' DirectSound secondary buffer to play as my game background-music ? If not, why not ? The other option, AFAIK, is having 'streaming' buffer for that. Which will be more complicated programmatically.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Hanan888 wrote:

      Does it seem reasonable to load a 40-sec WAV to a 'static' DirectSound secondary buffer

      Yes. Maximum buffer size is 0x0FFFFFFF...40 seconds 0f 44.1kHz, 24-bit stereo audio samples is around 10MB (if I did the math correctly :)). Should work fine. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      H 1 Reply Last reply
      0
      • M Mark Salsbery

        Hanan888 wrote:

        Does it seem reasonable to load a 40-sec WAV to a 'static' DirectSound secondary buffer

        Yes. Maximum buffer size is 0x0FFFFFFF...40 seconds 0f 44.1kHz, 24-bit stereo audio samples is around 10MB (if I did the math correctly :)). Should work fine. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        H Offline
        H Offline
        Hanan888
        wrote on last edited by
        #3

        Thanks. So, my kitschy background music won't break the system after all... perhaps the people listening to it would... :)

        Mark Salsbery wrote:

        Maximum buffer size is 0x0FFFFFFF...40 seconds 0f 44.1kHz, 24-bit stereo audio samples is around 10MB (if I did the math correctly ).

        Have you calculated something like this - buffer size: 0X0FFFFFFF = 16^7 - 1 bytes = 268,435,455 bytes WAV size: 40 sec * 3 bytes per sample (24-bit) * 44100 samples per second = 5,292,000 bytes

        M 1 Reply Last reply
        0
        • H Hanan888

          Thanks. So, my kitschy background music won't break the system after all... perhaps the people listening to it would... :)

          Mark Salsbery wrote:

          Maximum buffer size is 0x0FFFFFFF...40 seconds 0f 44.1kHz, 24-bit stereo audio samples is around 10MB (if I did the math correctly ).

          Have you calculated something like this - buffer size: 0X0FFFFFFF = 16^7 - 1 bytes = 268,435,455 bytes WAV size: 40 sec * 3 bytes per sample (24-bit) * 44100 samples per second = 5,292,000 bytes

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          Hanan888 wrote:

          Have you calculated something like this - buffer size: 0X0FFFFFFF = 16^7 - 1 bytes = 268,435,455 bytes WAV size: 40 sec * 3 bytes per sample (24-bit) * 44100 samples per second = 5,292,000 bytes

          Yes, except I took a worse-case scenario (unless you use a higher sampling rate :)) and chose stereo, so I multiplied your WAV size by 2. Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          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