rpgtkoolmv / corescript

http://www.rpgmakerweb.com/products/programs/rpg-maker-mv
MIT License
311 stars 75 forks source link

fix sound not playing under certain operations (smartphone) #209

Open rutan opened 4 years ago

rutan commented 4 years ago

I found a WebAudio._onVisibilityChange problem.

WebAudio._onHide and WebAudio._onShow adjust the volume when the browser visibility changes for Smartphone (especially Android OS). But, WebAudio._onHide and `WebAudio._onShow have different fade duration.

The following operations will cause problems.

  1. Launch game on Android Chrome
  2. Press the home button to hide Chrome (and run WebAudio._onHide )
  3. Open Chrome within 0.5 seconds (= 1sec - 0.5sec)

When this operation is performed, the fade-out time will be longer than the fade-in time. Then the sound will be muted all the time :cry: