Jump to content

DDowell

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by DDowell

  1. Sorry for being thick but if you want to play a looping sound AND have a starting position other than 0, is that possible? Is it possible only in 2.3?
  2. var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create });function preload() { game.load.image('speakers','assets/sprites/speakers.png'); game.load.audio('bass', 'assets/audio/tech/bass.mp3'); game.load.audio('drums', 'assets/audio/tech/drums.mp3'); game.load.audio('percussion', 'assets/audio/tech/percussion.mp3'); game.load.audio('synth1', 'assets/audio/tech/synth1.mp3'); game.load.audio('synth2', 'assets/audio/tech/synth2.mp3'); game.load.audio('top1', 'assets/audio/tech/top1.mp3'); game.load.audio('top2', 'assets/audio/tech/top2.mp3');}var bass;var drums;var percussion;var synth1;var synth2;var top1;var top2;var text;var sounds;var current;var speakers;var loopCount = 0;function create() { game.stage.backgroundColor = '#838282'; speakers = game.add.image(game.world.centerX, 500, 'speakers'); speakers.anchor.set(0.5, 1); var style = { font: "65px Arial", fill: "#52bace", align: "center" }; text = game.add.text(game.world.centerX, 100, "decoding", style); text.anchor.set(0.5); bass = game.add.audio('bass'); drums = game.add.audio('drums'); percussion = game.add.audio('percussion'); synth1 = game.add.audio('synth1'); synth2 = game.add.audio('synth2'); top1 = game.add.audio('top1'); top2 = game.add.audio('top2'); console.log("bass!" + bass); bass.onDecoded.addOnce(start, this); sounds = [ bass, drums, percussion, synth1, synth2, top1, top2 ]; // Being mp3 files these take time to decode, so we can't play them instantly // Using setDecodedCallback we can be notified when they're ALL ready for use. // The audio files could decode in ANY order, we can never be sure which it'll be. //game.sound.setDecodedCallback(sounds, start, this); start();}function start() { bass.play("",0,1,true,true); bass.onLoop.add(hasLooped, this); text.text = 'bass';}function hasLooped(sound) { console.log("bass looped!");}This example (played through the sandbox) works in 2.3.0 but fails in previous version (2.2.2 and earlier). This is in Chrome only.
  3. Seems like the issue is not with loopFull but with the loop flag on play.
×
×
  • Create New...