cucumber Posted January 26, 2014 Share Posted January 26, 2014 I want be able to change volume for all sounds and turn off all sound. I guess SoundManager is for this. But I can't find a way to use it properly. game.SoundManager.pauseAll()orvar sm = new Phaser.SoundManager(game);sm.pauseAll()does not work. Please provide some examples. Link to comment Share on other sites More sharing options...
MXPain Posted January 26, 2014 Share Posted January 26, 2014 -- sorry wrong topic Link to comment Share on other sites More sharing options...
rich Posted January 26, 2014 Share Posted January 26, 2014 It's set as a property on game:game.sound.method() kctang 1 Link to comment Share on other sites More sharing options...
cucumber Posted January 27, 2014 Author Share Posted January 27, 2014 Thank you!and one more question The property 'duration' of sound is 0 before sound is played once.What i'm doing wrong?How to get duration before playing sound? Link to comment Share on other sites More sharing options...
cucumber Posted January 28, 2014 Author Share Posted January 28, 2014 I need to know duration before playing sound and I found this weird solution sfx = game.add.audio('sfx');sfx.onPlay.add(function(s){ s.stop(); s.onPlay.removeAll(); console.log(s.duration); //s.play(null,s.duration/2);});sfx.play(); I'll wrap it in a function. Link to comment Share on other sites More sharing options...
cucumber Posted January 28, 2014 Author Share Posted January 28, 2014 But it didn't solve my problems. My Oggs and Mp3s have different durations because of gaps.I guess i have to make single file and use markers.I'm going to try this utility https://npmjs.org/package/audiospriteAnd also I heard about sound sprites in phaser from this topic http://www.html5gamedevs.com/topic/2962-sound-sprites/Is there an example how to use them? Link to comment Share on other sites More sharing options...
Recommended Posts