javascripthtml5-audiohowler.js

playing sounds with howlerjs stops after 1.99 seconds in chrome


I am trying to play a sound with howlerjs but it stops after 1.99 seconds in chrome. In firefox the soundclip is played in full length which is 10 seconds.

preview = new Howl({
           src: [soundLink],
           volume: 0
});

preview.once('load', function(){
  console.log("preview duration: "+preview.duration())
});

preview.play();

the output of console.log("preview duration: "+preview.duration()) is 1.9994331065759636 in Chrome and in Firefox this is 10.135510204081633. When I directly access the soundLink in Chrome it plays the sound for the full 10 seconds. I do not understand where this difference comes from or where I should be looking at. Can someone shine a light on this?

edit: On Chromes network tab I can see that the bytes of the file matches with the correct file size.


Solution

  • I found out that it had nothing to do with Howler.js but that the error was within the files themselves. Once I created new files, the clips were played fully. Still don't know what the problem with the files was though.