DirectSound buffers
-
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. -
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.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:
-
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:
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
-
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
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: