This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes playing audio from HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "playing audio from HTML" Watch "playing audio from HTML" New topic

playing audio from HTML

Jay Ram
Ranch Hand

Joined: Dec 13, 2005
Posts: 40

I was a software developer; now a stay at home mom for my kid. I am trying to develop a web page for my kid for him to learn different stuffs. Eventually, I would like to put it in the web so that other kids can use it.
As it is for kids, it involves lot of audios. For example, 1 page has a lot of flag images and when each flag is clicked, the kid gets to hear the country name.

My question is
1. Is it possible to make the sound without opening a media player. If
so how?
I cannot use <embed > because, i want the sound when the flag is
clicked not when the play button in the embed image is clicked.

2. Due to lot of audio files, will it take the page a long time to load?
if so, how to make it efficient?

Please guide me in this.

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
You may find an answer here:

Jay Ram
Ranch Hand

Joined: Dec 13, 2005
Posts: 40
Thanks Eric. You are always a big help to everybody here.

I'll try the things suggested in the page.

Alan Walker

Joined: Feb 15, 2004
Posts: 26
I found Mark Huckvale's Demonstration of Different ways to Play a Sound from a Web Page very useful.

Chihuahua - Ajax-powered online word puzzle, <a href="" target="_blank" rel="nofollow"></a> <br />Letterbox Word Game Online, <a href="" target="_blank" rel="nofollow"></a> <br />Lexi Word Game for Java-enabled phones, <a href="" target="_blank" rel="nofollow"></a>
Jay Ram
Ranch Hand

Joined: Dec 13, 2005
Posts: 40
Excellent Link Alan.

Thanks for your time.

I agree. Here's the link:
subject: playing audio from HTML
It's not a secret anymore!