Search the Community
Showing results for tags 'setDecodedCallback'.
-
Hi, I'm trying to check if the audio is ready before start the MainMenu. create: function () { this.addGameSrc(); Vendor.addSound(); Vendor.addMusic('main_menu', true); audios = [ music, sfx_Click, sfx_Drop, sfx_Explode ]; console.log(audios); this.status.setText('DECODING AUDIOS...'); this.sound.setDecodedCallback(audios, this.start(), this); }, start: function () { this.status.setText('READY'); setTimeout(function () { game.state.start("MainMenu"); }, 250); console.log("Splash\t\tOK"); },ERROR: TypeError: this._watchCallback is undefined I also tried this code: create: function () { this.addGameSrc(); }, update: function () { if (game.cache.isSoundReady('click', 'main_menu')) { this.startMenu(); } else { this.status.setText('DECODING AUDIOS...'); }; }, startMenu: function () { this.status.setText('READY'); this.state.start("MainMenu"); console.log("Splash\t\tOK"); },But it takes so long for decode, tested with S6 Edge and about 10 seconds waiting, doesn't matter if the audio is an mp3 or ogg with 5k or 500k, if it's one single file or ten files, make no sense for me... Plz, Someone can help me to fix this?
- 1 reply
-
- setDecodedCallback
- mobile
-
(and 2 more)
Tagged with: