howler.js icon indicating copy to clipboard operation
howler.js copied to clipboard

[2.0] Variable Bitrate Mp3s sometimes get cut off

Open Tolmark12 opened this issue 10 years ago • 3 comments

I'm seeing instances where the end event fires just before the audio actually completes. I don't recall seeing this with 1.0. Any ideas as to what has changed, or where I can dig?

Tolmark12 avatar Feb 07 '16 04:02 Tolmark12

Hmm, on second thought, it may just be clipping the audio before it finishes. I hear the audio play, but the last 100ms or so gets cut off. It seems to have something to to with the fact that I'm loading the audio, then playing the audio later. I don't see the error when I set preloading to true and just play immediately.

I've posted an example here : http://codepen.io/tolmark12/pen/vLVzMR?editors=0010

DOES Cut off the last bit of audio:

var sound;

onSoundLoaded = function(){
  sound.play()
} 

data = {
  src         : "http://twoway.gopagoda.io/episodes/episode0/sounds/Story_1_Ctanlee_7.mp3"
  onload      : onSoundLoaded
  preload     : false
}
sound = new Howl(data).load();

DOES NOT Cut off the last bit of audio:

data = {
  src  : "http://twoway.gopagoda.io/episodes/episode0/sounds/Story_1_Ctanlee_7.mp3"
}
sound = new Howl(data).play();

Tolmark12 avatar Feb 07 '16 05:02 Tolmark12

Update, it appears that the real issue is with variable bitrate MP3s, sorry for the confusion!

Title Edit : Updated title of issue to indicate correct issue

Tolmark12 avatar Feb 08 '16 15:02 Tolmark12

I'm having trouble reproducing the issue, and it appears that your codepen is no longer working. Do you have an updated sample?

goldfire avatar Feb 26 '16 19:02 goldfire