kurhlaa Posted November 26, 2018 Share Posted November 26, 2018 Hello, I try to play multiple short sound files. The problem is that it looks like sound files are not being played from cache - when I replay the sound which wasn't played for some seconds I see a noticeable screen freezing, like lag. It feels like JavaScript removes it from cache after 1-2 seconds and then reads/loads the file again on replay. I tried to play sounds with 2 methods: 1. directly: this.sound.play("soundname"); 2. from the instance: var music = this.sound.add('soundname'); ... // After some delay during the game music.play(); but result is the same - freezing is very noticeable on almost all replays. Maybe it's not a cache problem, it just feels like that. What can I do to prevent freezing (or to stay sounds in memory)? Pavel Mishin 1 Link to comment Share on other sites More sharing options...
kurhlaa Posted November 26, 2018 Author Share Posted November 26, 2018 Update: if I play a test long audio in a background - freezes disappear. Could it be that sound manager initializes something all the time, what can/should be done only once? Link to comment Share on other sites More sharing options...
Recommended Posts