yonathan Posted December 13, 2015 Share Posted December 13, 2015 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? Link to comment Share on other sites More sharing options...
yonathan Posted December 17, 2015 Author Share Posted December 17, 2015 Testing on Android 4.4 or iOS (no sure the version) the methods:isSoundReadyOrisSoundDecodedMakes the app stop, so, it's another problem... Link to comment Share on other sites More sharing options...
Recommended Posts