samtupy / nvgt

The Nonvisual Gaming Toolkit
https://nvgt.gg
Other
53 stars 36 forks source link

short sound delays during window pulling #126

Open acerbt opened 1 week ago

acerbt commented 1 week ago

This issue appears to come up in instances where the game tries to window pull. There should be no gaps in sound playback normally, but window pulling appears to cause some sounds to be slightly delayed, depending on the context where it's being played. This lag goes away when testing without a window shown for the script. I'm attaching a zip containing test scripts to help with hopefully fixing this issue. This includes a test script that has the window and another without it. bop it 2002 sound delaying test.zip

harrymkt commented 1 week ago

Hello.

In this case, could you test with the following in the one with window?

  1. Remove wait(1);.
  2. Put wait(5); at the bottom of while loop. For example,
    while(true)
    {
    //Your codes
    wait(5);
    }

    Because using wait method in top and bottom might say differently.

Let me know if there's anything.

acerbt commented 1 week ago

I actually have seen wait(5) cause performance issues itself, when timing is critical. I also forgot to say that this only appears to happen on Windows and Mac, but not Linux. ON Windows, it's with modern versions, and it will actually be more noticible on computers with lower end processors. Even on my computer with a high end chip there are slight delays in places. I can't say anything for the performance on android, since I haven't compiled the game this test came from on that platform yet.