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.