DirectSound Effects/3D Sounds Issues

Reporter: RobertBColton  |  Status: open  |  Last Modified: January 21, 2019, 12:18:38 AM
So the problem we tried to fix in #1507 is that DirectSound buffers that have DSBCAPS_CTRLFX cannot be less than DSBSIZE_FX_MIN (150ms) in length or creation of the sound buffer returns an error code that the buffer is too small. We think we need DSBCAPS_CTRLFX though so that we can control any sound effects that are set on the buffers dynamically at runtime, since GM8 also allowed this. ProtoLink on Discord ran into this issue with a short click WAV sound, and I had noticed it before in several of Mark Overmar's examples (specifically the Pacman game included in GameMaker 6) where short sound effects (like click.wav) will cause the game to segfault on open.

Download Mark Overmar's click sound:

So the first thing @rpjohnst helped do was find the actual minimum size of a buffer that has DSBCAPS_CTRLFX specified. We succeeded in doing so, but then realized we had to populate the rest of the buffer with silence, since we were now growing it. Finally, this introduced noticeable differences in the loop behavior of the sounds compared to GM8.

Download looping test:

The best work around for now is to just remove DSBCAPS_CTRLFX if you need to because the sound effects features are not even functional and only half finished anyway. Also due to a bug in the msys2 headers for DirectSound, it's not even currently possible to finish the sound effects feature.

The remaining tasks for this system include:

  • Needs to use DirectMusic for sounds with "Use multimedia player" checked.
  • 3D sounds need implemented properly and tested.
  • Sound effect flags need implemented.
  • Need support for playing MIDI files.
  • <
Please sign in to post comments, or you can view this issue on GitHub.