goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
23.88k stars 2.23k forks source link

[2.0] Variable Bitrate Mp3s sometimes get cut off #447

Closed Tolmark12 closed 8 years ago

Tolmark12 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

goldfire commented 8 years ago

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