javascriptsoundjs

SoundJS: Partial Preload


I am developing a simple quiz game for fun. The player has to listen to a MP3 file and guess the associated game and/or character's name. Currently, I am preloading the whole audio file through SoundJS. The game can be tried here: http://simon.pcharest.ca/quiz/

What I would like to do is to preload and play only a 10 seconds audio clip, starting at a random position. This would make the loading much shorter and the game a bit harder too.

Is this something doable with SoundJS, and if so, could anyone please point me in the right direction?

Thank you very much for your time.


Solution

  • createjs.Sound.play("MyAudioSprite", {startTime: 1000, duration: 400});

    Source: http://www.createjs.com/docs/soundjs/classes/AudioSprite.html