CreateJS / SoundJS

A Javascript library for working with Audio. It provides a consistent API for loading and playing audio on different browsers and devices. Currently supports WebAudio, HTML5 Audio, Cordova / PhoneGap, and a Flash fallback.
http://createjs.com/
MIT License
4.42k stars 838 forks source link

Using <source> tags to enable multiple audio format support. #6

Closed amari closed 12 years ago

amari commented 12 years ago

Safari lacks Ogg support, and Firefox and Chromium do not support Mp3. This is much more future proof than the current solution of swapping the file extension for different browsers.

For example, what if chrome dropped ogg in favor of some webm-like audio format. Code would have to be updated, existing assets would need to be converted.

If the source tag were to be used, then the developer could change

SoundJS.filetypes = ["ogg", "mp3", "m4a"] to SoundJS.filetypes = ["ogg", "mp3", "m4a", "weba"] without having to fiddle with documentation of the audio formats that a browser supports.

The browser would only load the format that it needs.

amari commented 12 years ago

Never mind, failed to read documentation in SoundJS.js