Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipped sound effect playblack #1471

Closed
UglyDuckling2k opened this issue Dec 19, 2014 · 4 comments
Closed

Clipped sound effect playblack #1471

UglyDuckling2k opened this issue Dec 19, 2014 · 4 comments

Comments

@UglyDuckling2k
Copy link

I have a problem which affects all browsers (IE a bit more). When i play a sound effect with a short duration (click effects for example) the sound effect sometimes is clipped or does not play at all.

@UglyDuckling2k
Copy link
Author

I preload my audio assets like this:

this.load.audio('Intro', ['/Intro.ogg', 'Intro.mp3']);

then I load and playback the audio like this;

this.audioIntro = this.add.audio('Intro');
this.audioIntro.play();

@UglyDuckling2k
Copy link
Author

Is anyone else experiencing these problems?

@photonstorm
Copy link
Collaborator

If there is any latency involved in starting playback of the audio (i.e. decoding time, or seeking within a larger audio sprite) then it's entirely possible the timer will assume the sound has finished playing before it has even begun.

I'm not sure of your exact set-up - this can be very specific to the actual audio files being used and the way they're encoded, so we'll need a proper test case to investigate further including the audio causing the problem. Feel free to re-open this if you can provide one.

photonstorm added a commit that referenced this issue Feb 18, 2015
…ill stop playing instead of using a time based value. This is only used if the sound doesn't loop and isn't an audio sprite, but will give a much more accurate `Sound.onStop` event. It also prevents short audio files from being cut off during playback (#1471) and accounts for time spent decoding.
@photonstorm
Copy link
Collaborator

Actually I've just pushed up a change to the Sound class that should help with this issue massively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants