onemaxone

Members
  • Content count

    6
  • Joined

  • Last visited

  1. Hey RalphWiggum, below is a simplified version of the code that I am using - with the below, general_sounds[1] plays but 0 and 2 don't. If I put the loadGeneralSound(); call in create(){} instead of preload(){} I get the error below the code. I can try to switch out the phaser js as you mention and paste the error in also. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Snap - it's kids play!</title> <script type="text/javascript" src="js/phaser.min.js"></script> <style type="text/css"> body { margin: 0; } </style> </head> <body> <script type="text/javascript"> var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create}); var general_sounds = []; function preload() { // load general sounds loadGeneralSound(); } function create() { general_sounds[0].play(); general_sounds[1].play(); general_sounds[2].play(); } // loads general sounds that are not object specific function loadGeneralSound() { game.load.audio('sound.correct', 'assets/sound.general/sound.correct.mp3'); game.load.audio('sound.incorrect', 'assets/sound.general/sound.incorrect.mp3'); game.load.audio('voice.correct', 'assets/sound.general/sound.well_done.m4a'); general_sounds[0] = game.add.audio('sound.correct'); general_sounds[1] = game.add.audio('sound.incorrect'); general_sounds[2] = game.add.audio('voice.correct'); } </script> </body> </html> Errors if I put the loadGeneralSound(); call in create(){} instead of preload(){}: Phaser CE v2.7.7 | Pixi.js | WebGL | WebAudio http://phaser.io ♥♥♥ phaser.min.js:3 Phaser.Cache.isSoundDecoded: Key "sound.correct" not found in Cache. getItem @ phaser.min.js:3 isSoundDecoded @ phaser.min.js:3 play @ phaser.min.js:3 create @ snap.html:27 loadComplete @ phaser.min.js:3 preUpdate @ phaser.min.js:3 updateLogic @ phaser.min.js:3 update @ phaser.min.js:3 updateRAF @ phaser.min.js:3 window.requestAnimationFrame.forceSetTimeOut._onLoop @ phaser.min.js:3 phaser.min.js:3 Phaser.Cache.getSound: Key "sound.correct" not found in Cache. getItem @ phaser.min.js:3 getSound @ phaser.min.js:3 play @ phaser.min.js:3 create @ snap.html:27 loadComplete @ phaser.min.js:3 preUpdate @ phaser.min.js:3 updateLogic @ phaser.min.js:3 update @ phaser.min.js:3 updateRAF @ phaser.min.js:3 window.requestAnimationFrame.forceSetTimeOut._onLoop @ phaser.min.js:3 phaser.min.js:3 Phaser.Cache.isSoundDecoded: Key "sound.incorrect" not found in Cache. getItem @ phaser.min.js:3 isSoundDecoded @ phaser.min.js:3 play @ phaser.min.js:3 create @ snap.html:28 loadComplete @ phaser.min.js:3 preUpdate @ phaser.min.js:3 updateLogic @ phaser.min.js:3 update @ phaser.min.js:3 updateRAF @ phaser.min.js:3 window.requestAnimationFrame.forceSetTimeOut._onLoop @ phaser.min.js:3 phaser.min.js:3 Phaser.Cache.getSound: Key "sound.incorrect" not found in Cache. getItem @ phaser.min.js:3 getSound @ phaser.min.js:3 play @ phaser.min.js:3 create @ snap.html:28 loadComplete @ phaser.min.js:3 preUpdate @ phaser.min.js:3 updateLogic @ phaser.min.js:3 update @ phaser.min.js:3 updateRAF @ phaser.min.js:3 window.requestAnimationFrame.forceSetTimeOut._onLoop @ phaser.min.js:3 phaser.min.js:3 Phaser.Cache.isSoundDecoded: Key "voice.correct" not found in Cache. getItem @ phaser.min.js:3 isSoundDecoded @ phaser.min.js:3 play @ phaser.min.js:3 create @ snap.html:29 loadComplete @ phaser.min.js:3 preUpdate @ phaser.min.js:3 updateLogic @ phaser.min.js:3 update @ phaser.min.js:3 updateRAF @ phaser.min.js:3 window.requestAnimationFrame.forceSetTimeOut._onLoop @ phaser.min.js:3 phaser.min.js:3 Phaser.Cache.getSound: Key "voice.correct" not found in Cache. getItem @ phaser.min.js:3 getSound @ phaser.min.js:3 play @ phaser.min.js:3 create @ snap.html:29 loadComplete @ phaser.min.js:3 preUpdate @ phaser.min.js:3 updateLogic @ phaser.min.js:3 update @ phaser.min.js:3 updateRAF @ phaser.min.js:3 window.requestAnimationFrame.forceSetTimeOut._onLoop @ phaser.min.js:3
  2. Hi, I have just replaced the minified Phaser js with the latest version (2.7.7) in my phaser app and my audio in my app has stopped working. The rest of the app still works well. The code to load the audio is pretty simple - I first load the audio and then add the audio assigning it to an array. game.load.audio('sound.correct', 'assets/sound.general/sound.correct.mp3'); general_sounds[0] = game.add.audio('sound.correct'); When I come to playing the audio I just use: general_sounds[0].play() Which worked in 2.0.1 but now I get the error I get is as per below: phaser.min.js:3 Uncaught TypeError: Cannot read property 'createBufferSource' of null at c.Sound.play (phaser.min.js:3) at <anonymous>:1:19 play @ phaser.min.js:3 (anonymous) @ VM1834:1 What's more odd is that when I run the above 3 commands in the console the sound plays. Does anyone know what is going on?
  3. Just realised that when working with the dev app you only need to move the www folder.
  4. Hi, I have created a game in Phaser and it runs file on my local machine via XAMPP. I have reshuffled my files to align to the Cocoon structure as per their example (basically just used the default Cocoon template, switched out a few files and editor the config.xml file with my own params), successfully compiled the app via Cocoon.io cloud service and created the .ipa file which I have put onto my device (the iPad mini). However, when I run the file I get a black screen. I downloaded and installed the developer app on my iPad and dropped my zipped game into it. Then I ran the game via canvas+ and got these errors - the first when I run the app, the ones in red when I look at the debug. Any ideas what is going on? Completely at loss on this one. Max.
  5. phaser

    Thanks for this - works perfectly!
  6. phaser

    Hi I have built an app in Phaser and want to create a sequence of two sounds: 1. "You have" (loaded and stored as audioSound[0]) 2. "Finished" (ditto, audioSound[1]) I can then keep re-using 1 and have different words/sentences in 2. To do this I need the sounds to play in sequence. At the moment using: audioSound[0].play(); audioSound[1].play(); othercode... Plays both at the same time. Any ideas on how to get the sounds to play in sequence and only continue to `othercode...` once the second one has finished? Thanks in advance!