1

I would like to ask if preloadJS and soundJS libraries support the use of webM and webA video/audio files, because I am having trouble using them.

A sample of my code :

//Plugin setup and preload files 
createjs.Sound.alternateExtensions = ["weba"]; 
queue.installPlugin(createjs.Sound);
queue.addEventListener("fileload", handleFileLoad);

queue.loadFile({id:"test_mp3", src:"./sounds/mp3.mp3"});        
queue.loadFile({id:"test_weba", src:"./sounds/weba.weba"}); 
queue.loadFile({id:"test_ogg", src:"./sounds/ogg.ogg"});

//file loading handler for audio files creates an array of sound objects
function handleFileLoad(event)
{   
    if((event.item.ext=="mp3") || (event.item.ext=="weba") || (event.item.ext == "ogg") )
        soundList[event.item.id] = createjs.Sound.createInstance(event.item.id);
}

//Trying to play audio
soundList[test_mp3].play();     //works fine
soundList[test_ogg].play();     //works fine
soundList[test_weba].play();    //not working, no errors just no sound

//Trying without preloaded files fails too
createjs.Sound.registerSound("./sounds/weba.weba", "testtt"); //returns false

The above sample will create 2 WebAudioSoundInstance objects (for mp3 and ogg files) and 1 AbstractSoundInstance (for weba file). Seems like weba is not recognized as an audio file or it fails to create a soundJS object for some other reason.

Using a simple html5 audio tag like this works fine

<audio preload="auto" controls autoplay>
   <source src="./sounds/weba.weba">
<audio> 

I am using versions 0.6.1 for both soundJS and preloadJS and the latest google chrome release.

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
ktsangop
  • 1,013
  • 2
  • 16
  • 29
  • 1
    I opened a bug here: https://github.com/CreateJS/SoundJS/issues/212 – Lanny Oct 19 '15 at 15:17
  • Thank you @Lanny. You can answer the question whenever it's resolved. I suppose it should be left open for now. – ktsangop Oct 19 '15 at 15:20
  • Added some testing notes to the doc. HTML audio in Chrome returns "" for `canPlayType`, so the container format will have to be determined, and weba added to the extension map. – Lanny Oct 19 '15 at 15:34

0 Answers0