Jump to content

Common Phaser + CocoonJS issues


Videlais
 Share

Recommended Posts

On 12/3/2014 at 7:39 AM, valueerror said:

Huh.. THX for the reply ludei.. I'm going to look into it and search for a workaround..

I use the chance to reach you here.. Could you please answer my question about the android bottom bar.. Is it possible to "really" go full screen and hide it like its done in other apps.. So you need to swipe from the bottom to make it appear.. ?? Thx again..

Did you ever find a workaround for the issue of the audio getting cut off at the end?

Link to comment
Share on other sites

On 12/3/2014 at 6:09 AM, Ludei said:

Hello, 

 

@valueerror, I've been looking at this problem, and it's not gonna be an easy one to solve. It is definitely a bug on our side, but it's a high-level one, regarding how the pause, stop and play operations should behave. This, combined with how OpenAL handles buffering (already committed chunks of audio cannot be stopped from our side) means we have big trouble handling calls to pause and play in rapid succession.

 

In this case, we have 2 audio buffers of 100ms each which as I said we cannot manually stop once committed to OpenAL, so when you call pause it will take 100-200ms for the sound to actually stop playing.

 

However, if you call play right after that, the audio will start playing immediately from the next point in the audio file, which is 200ms in the future, as those next 200ms will be in-flight inside OpenAL at this point. This creates the effect you're experiencing where you miss 200ms of audio, as Phaser does a pause/play combination in the same frame to handle audio looping (probably to support audio sprites).

 

This would unfortunately be quite difficult for us to solve without re-writing half of our audio system, as it affects other parts of how it is structured.

 

To fix this issue in Phaser, I'd recommend finding a way to avoid doing pause+play to do the looping, and instead rely on the loop property of the audio objects. I understand this won't work for audio sprites, but for typical background music scenarios it should work fine.

 

Sorry for the inconvenience. 

 

Regards. 

@Ludei

Has the issue with Cocoon cutting off the last 200ms of audio been fixed? Or at least a workaround? With the latest versions of Cocoon and Phaser, this is still happening for me where the audio is being cut off at the end. Happens on audio that isn't being paused/resumed or looping. 

Thoughts? Thanks!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...