flogvit Posted January 9, 2016 Share Posted January 9, 2016 I have a strange problem with the sound (tried Phaser 2.3.0 and Phaser 2.4.4) I do the loading of sound in preloading asthis.load.audio('music', 'assets/music/freefreddy_mixdown.mp3');and I start the sound with something likegame.music = game.add.audio('music', 1, true);game.music.play();I also have sounds which should be played. This works fine in all other browsers than Safari. But in Safari, it works strange If I start a vanilla Safari and type in the url (web or localhost:9000) it will load the game, but in the resource tab in Safari debug it will not show any XHRs directory (which includes all the .mp3 files). Now it will not play any sounds. But if I do a refresh on the page (cmd-r or enter in url), it will load the XHRs and play the sounds fine. I've tried the button approach where the splash screen, or the boot screen, have a button, but this doesn't work. Same problem with no XHRs directory in resources. When I check the SoundManager, console.log(game.sound), I see a difference. With reload, I get SoundManager._sounds[1].Sound.context[webkitudioContext].state = "running" without the reload this is set to "suspended". Anyone else seen this? Link to comment Share on other sites More sharing options...
flogvit Posted January 9, 2016 Author Share Posted January 9, 2016 Well, after struggling with this for a long time, and posted this question, I thought I should try to reload the SoundManager. It seems this works well. So now I do in boot:init: { this.game.sound.boot();}and that starts the sound, even though it doesn't show the XHRs in the resource list. btw, I need to wait until init in first state to do the boot, or else it doesn't work. Link to comment Share on other sites More sharing options...
flogvit Posted January 9, 2016 Author Share Posted January 9, 2016 Hm, still some problems using browsers on iPhone. So open for suggestions. Link to comment Share on other sites More sharing options...
brianautumn Posted January 11, 2016 Share Posted January 11, 2016 Hey Im getting similar problems, but with the sound manager unlocking webAudio. I tried reloading the sound manager like you posted, but no luck. http://brianautumn.net/rockalingua_prototypes/skateboarding/ I cant get audio to play on mobile for the life of me Link to comment Share on other sites More sharing options...
Moña Games Posted May 17, 2016 Share Posted May 17, 2016 Did any of you manage to get the sound working? Brian, your online game sound is working on my ipad. Thanks Link to comment Share on other sites More sharing options...
mstx Posted May 25, 2016 Share Posted May 25, 2016 On 8 January 2016 at 1:22 AM, flogvit said: Well, after struggling with this for a long time, and posted this question, I thought I should try to reload the SoundManager. It seems this works well. So now I do in boot: init: { this.game.sound.boot();} and that starts the sound, even though it doesn't show the XHRs in the resource list. btw, I need to wait until init in first state to do the boot, or else it doesn't work. I searched and tried everything, even tried to refresh page but nothing worked except this. Thank you! By the way how it's possible that only we've encountered this problem? Even Rich didn't mention anything about that?? Link to comment Share on other sites More sharing options...
micsun-al Posted August 29, 2016 Share Posted August 29, 2016 I'm getting this issue with the current build of Phaser. * v2.6.2 "Kore Springs" - Built: Fri Aug 26 2016 01:02:57 Link to comment Share on other sites More sharing options...
Befive.Info Posted September 19, 2016 Share Posted September 19, 2016 Thanks a lot. I just noticed that I had the same problem. The 1st load of the game on local server prevents the game from playing any sound at all when I open the game in the Desktop Safari browser (Version 9.1.3) on El Capitan (OSX 10.11.6). It plays normally only after I hit the reload button of the browser. I am using Phaser v2.6.1 for my game. game.sound.boot(); right after a loop for load.audio() sorted out. My game is playing sound normally from the 1st loading. Link to comment Share on other sites More sharing options...
Recommended Posts