RyuMaster Posted February 17, 2016 Share Posted February 17, 2016 Hi! I am using the latest stable phaser build. When I minimize the app, sound fades out, but it keeps on 'playing', because when I get back, I can see sound position updated further way in sound debug info. But, the actual sound is played from the position I left. Can anyone confirm, that it is a bug? The should not be any fade in/out at all, sound should just continue playing. this.stage.disableVisibilityChange = true; this is set. I tested on iphone 4 and iphone 6; It can be reproduced with this simple example: http://phaser.io/examples/v2/audio/play-music (just need to add this.stage.disableVisibilityChange = true); Link to comment Share on other sites More sharing options...
Zeterain Posted February 17, 2016 Share Posted February 17, 2016 I'm not sure if this is a bug, but you could try using the Stage.visibilityChange event and pause the sound when the game loses focus. I'm also pretty sure that the fading in/out is caused by the phone's OS muting the sound as the application loses focus. Link to comment Share on other sites More sharing options...
RyuMaster Posted February 17, 2016 Author Share Posted February 17, 2016 I need the sound to keep on playing, that is the reason why I am struggling with it. Yes, it might be so that iOS fades sound out of focus lost, but, it does not happen for other website, which has webaudio player and does not use Phaser framework. So this must be phaser-specific. Too bad, I have no clue where to start looking, I did not find and focus-related code for the sounds inside source code of phaser, and my idea of setting forceSetTimeOut: true made no difference Link to comment Share on other sites More sharing options...
Zeterain Posted February 17, 2016 Share Posted February 17, 2016 Ah, sorry, didn't see that part of your post. In that case, I'm not sure :\ I do know of sites that do what you want, but I also am not aware of the difference between the way they play audio and the way phaser does. Link to comment Share on other sites More sharing options...
RyuMaster Posted February 17, 2016 Author Share Posted February 17, 2016 I see, no problem, thanks for answering! This is probably too hard for me to solve, so I'll just use 3rd party scripts to play audio for now. Hope it will get addressed and fixed later at some point. Link to comment Share on other sites More sharing options...
Zeterain Posted February 17, 2016 Share Posted February 17, 2016 So, I've been reading through the updates to Phaser introduced in 2.4.5, and I've noticed sound and sound manager is referenced several times. It might be worth updating and trying out your game again and see if maybe this update magically fixed things. Link to comment Share on other sites More sharing options...
Recommended Posts