Web programming: sound
The tutor discusses his recent discovery of putting sound on a web page.
When I program, it’s usually something new – testing a new function, illustrating the implementation of a new idea, or what have you. The point: often, I don’t know the scope of the problem at first, and it ends up more challenging than expected. (An example was when I realized the bell doesn’t work on my Linux computer; see my post here.)
But statistically, wouldn’t you expect at least, that some programming problems end up simpler then expected? Maybe not so often, but it certainly does happen, and here’s an example: putting sound on a web page.
Perhaps going back to the workaround I developed for my Linux computer’s bell, I’ve become fascinated by sound files and how to activate them from programs. Yesterday I wondered about activating a sound from JavaScript. I checked around, but nothing jumped. I came to wonder if incorporating sound on a web page is even easier than I’d thought. Can it, I asked, just be done with a file link? The answer turns out to be yes.
I’m showing two ways in this post: one with the <embed> tag, the other with the simple <a> tag. The <embed> tag plays the sound spontaneously, whereas the <a> link you need to click to play the sound.
click here for sound (<a> link)
The sound you hear is a heavy spoon clinking against a heavy coffee cup. The curious can find more about that in my May 13 post.
I intend to talk more about sound files. Related topics have surfaced even during the writing of this post.
HTH:)
Source:
Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.
Leave a Reply
You must be logged in to post a comment.