The Howler JavaScript library assists us with adding sound into our web pages. The following video clip shows the very basics of using this framework.
The code sample in this video clip together with the MP3 file I am using can be downloaded at http://www.abelski.com/courses/howler/howlerdemo.zip. The MP3 file was downloaded from http://www.classiccat.net.
<!DOCTYPE html> <html> <head> <title>howler sample</title> <script type="text/javascript" src="howler.js"></script> <script type="text/javascript"> var ob = new Howl({urls:['gershwin.mp3']}); function playmusic() { ob.play(); } function stopmusic() { ob.stop(); } </script> </head> <body> <input type="button" onclick="playmusic()" value="play"/> <input type="button" onclick="stopmusic()" value="stop"/> </body> </html>
I have just complete do develop the Howler Basics new course for learning the basics of using this framework. You can find it at http://abelski.lifemichael.com. That course is available for free personal and academic usage.