HTML and CSS Reference
In-Depth Information
We simply play sounds in this task. We can do more with SoundJS, such as controlling the
volumes. The following URL contains the documentaion of the SoundJS library with detailed
discussion on its usage:
http://www.createjs.com/#!/SoundJS/documentation
Classified intel
We need several file formats of the audio file because different browsers support different
formats. With the help of the SoundJS library, we provide three to four formats, and the
library will choose the one that can be played in the browser.
The following table shows the audio format support available at the ime of wriing this topic:
Browsers
Ogg
WAV
AIFF
WebM
Google Chrome
Yes
Yes
No
Yes
Mozilla Firefox
Yes
Yes
No
Yes
Apple Safari
Yes
Yes
Yes
No
Internet Explorer
No
No
No
No
Actually, browser compaibility is more complicated than what is shown in the preceding
table. The support is different for different browser versions. The mobile version of browsers
makes things more complicated. I recommend checking the browser support online while
working on a new project. It is because the browser upgrade may add or remove support for
certain audio formats. The following URL contains a good aricle on the latest web audio:
https://developer.mozilla.org/en-US/docs/HTML/Supported_media_formats
Note that the MP3 format is not really free to use. The patent of MP3
makes serving MP3 files to individuals cost a huge license fee. So, please
use MP3 cauiously and only as the last choice. The following URL is one
among the many aricles that discuss the issues you get using MP3 and
web audio:
https://www.scirra.com/blog/64/why-you-shouldnt-
use-mp3-in-your-html5-games
 
Search WWH ::




Custom Search