Sounds During Create
Reporter: RobertBColton | Status: closed | Last Modified: November 19, 2020, 09:32:07 am This broke sometime before #1767 and does not occur in OpenAL, only DirectSound. If you make a new game, add a sound, add an object, and play the sound from the object's create event, it won't play when the game starts. Move the sound play to step event and it will play. Could be related to #1770.
RobertBColton
Further regression testing shows it does still occur. It only occurs with certain sounds such as the official "beep1.wav" in GM6 installation or "beep3.wav" in GM8 installation. Other sounds like "applause.wav" do not reproduce it. The issue also does not exist in GM8.1 suggesting it is indeed an ENIGMA problem.
Did some more testing recently and while I can't completely narrow it down, there are some things that seem to be related.
- It seems to be effected by initial Window visibility (#2035) as adding WS_VISIBLE alleviates some of it.
- Adding
DSBCAPS_GLOBALFOCUS
to the secondary buffers seems to help.
It is possible to set the cooperative level using GetDesktopWindow()
but it does not seem to help. Note in that case you have to add DSBCAPS_GLOBALFOCUS
to the secondary buffers to hear them anyway.
https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mt708948(v=vs.85)#remarks
With #2166 I had an idea about fixing #1508 by stretching short audio buffers and increasing their sample rate. That would allow us to enable effects on the short audio clips that DirectSound would previously crash on. Testing GM8.1 does indicate that it must do something similar as it does allow effects on the sample wav clips and does not break the looping behavior. It's possible that solution may also fix this issue and explain why GM8.1 doesn't have the problem. Although the global focus fix was probably still required too, since ENIGMA still has issues with initial window visibility.
Leave a commentView this issue on GitHub
Please sign in to post comments, or you can view this issue on GitHub.