Jump to content

Looks like sound files are not being played from cache


kurhlaa
 Share

Recommended Posts

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)?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...