Search the Community
Showing results for tags 'audiosprite'.
-
We're using `AudioSprite`s for our character's dialog in a Phaser Game. We're loading both `.mp3` and `.ogg` files to support the various browsers. After loading the files on our state's `preload()` we decode them before playing. We've got an issue on Safari where after about 20 minutes of gameplay, the audio begins to slow down and cut-off. The cut-off makes sense as the audio sprite is only set to play for a certain amount of time, but I've no idea why the audio would slow down. The issue on Chrome is similar, except the audio becomes filled with static. The audio sprites are not very big, the VO is 18MB, the SFX is 209kB, and the background music is 2.1MB. Thoughts on what is wrong and/or how to go about debugging this?
-
Hi, just found, that Internet Explorer 11 can not play multiple sounds at time when using audiosprite with markers. When I ask it to play new sound, it stops the one it is currently playing. I have set allowMultiple = true; and it works in both FF and Chrome, but not in IE. How do you solve it? Can you use audiosprites and play multiple sounds in IE? Is it possible? Or do I have to cut it into separate sound files and then load one by one?
-
I'm loading and playing an AudioSprite with JSON which works fine. But when I try to listen for the end of the sound I get a type Error. game.load.audiosprite('sfx', ["snd/animalSounds.mp3", "snd/animalSounds.ogg"], "snd/animalSounds.json",true); fx = game.add.audioSprite('sfx'); fx.allowMultiple = true; fx.play("intro"); fx.onStop.add(soundStopped ,this); onloadphaser.js:70687TypeError: undefined is not an object (evaluating 'fx.onStop.add') Can this be done using .onStop?
- 2 replies
-
- phaser
- audiosprite
-
(and 1 more)
Tagged with:
-
Hey all, i've noticed a weird behaviour from the soundManager. The loop of an audio sprite's marker gets broken after switching states. So to further help explain my problem, this is how i am doing things: // start preload state this.load.audio("audioSprite", ["assets/audio/audioSprite.mp3", "assets/audio/audioSprite.ogg"]); then when onLoadComplete gets called: this.game.audioSprite = this.game.add.audio("audioSprite");this.game.audioSprite.allowMultiple = true; this.game.audioSprite.addMarker("themeSong", 0, 19.2, 1, true); //(key, startingPoint, duration, volume, loop)and 7 more markers//end preload state //start menu statethis.game.audioSprite.play("themeSong");//end menu state As long as i do not switch states, the "themeSong" will continue to play and loop, but if i switch state to, say levelSelect,the "themeSong" will continue to play to the end of the specified duration but will not loop!? Any help is appreciated
- 2 replies
-
- audio
- audioSprite
-
(and 1 more)
Tagged with:
-
Hello everyone, sorry if this topic was discussed already, I couldn't find anything about it on the forum. I am relatively new to javascript and phaser, a hand would be great: I am trying to create a "music game" and I am looking for the best solution to play markers continuously from an audio file. here is part of my code: function onCreate() { console.log("onCreate") music = game.add.audio('music'); music.allowMultiple = false; music.addMarker('lvl1_1',0,1); music.addMarker('lvl1_2',1,1); music.addMarker('lvl1_3',2,1); music.addMarker('lvl1_4',3,1); music.addMarker('lvl1_5',4,1); music.addMarker('lvl1_6',5,1); music.addMarker('lvl1_7',6,1); music.addMarker('lvl1_8',7,1); music.addMarker('lvl1_9',8,1);[...]function playclicked(){ for (var i = 1; i <= maxvalue; i++){ music.play("lvl"+level.number+"_"+i); while(music.isPlaying){console.log(music.isPlaying);} } } in few words, the loop should be able to play the first marker, wait for it to complete and then play the next marker, and so on. The while loop won't get past the !music.isPlaying condition, maybe I am doing something wrong there..? The loop should also be clean enough to make the markers transition smooth, cause I am playing a song. also I am using game.load.audio(...) and not game.load.audiosprite(...) ; I previously used an audiosprite with json but I am not sure how to call out properties such isPlaying while working with it.. if someone could be so kind to explain how that works, I'd appreciate! thank you very much!!
-
Hello, I am developing an Asset Manager editor for Eclipse and I need a better understanding of how the audio sprites work. My doubt is about the JSON format of the audio sprite. In the Phaser doc it says: "Audio Sprites are a combination of audio files and a JSON configuration. The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite" This is the example (of the audio sprite JSON) there is in that github repo overview: { "resources": [ "mygameaudio.caf", "mygameaudio.ac3", "mygameaudio.mp3", "mygameaudio.m4a", "mygameaudio.ogg" ], "spritemap": { "bg_loop": { "start": 0, "end": 3.75, "loop": true }, "click": { "start": 5, "end": 5.3, "loop": false } }, "autoplay": "bg_loop"}Note there is a "resource" section where are listed the audio files of the same "sound", but with different format. Now, if you see the "audiosprite" method of Phaser, it requires to pass the "urls" of the sounds files. So for me this is redundant. I see in the Loader code that it always load the audio files given in the "urls" parameter. I think what happen is that Phaser ignores the "resources" section of the JSON. Is it true? Maybe it is better to read the "urls" from the JSON too, but well, for now I just need to someone to confirm the "resources" section of the JSON is ignored. Thanks in advance