This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Play .wav in Jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Play .wav in Jsp" Watch "Play .wav in Jsp" New topic
Author

Play .wav in Jsp

Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Hi all,
How can i play an audio file (.wav) on a button click in Jsp ?


Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Just include a link to the wav file in the HTML your JSP generates. Assuming your user's browser is configured to play wavs it should just play.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Originally posted by Paul Sturrock:
Just include a link to the wav file in the HTML your JSP generates. Assuming your user's browser is configured to play wavs it should just play.

Oh !! Then how to play it when the page loads shoud use only java script right ?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

No need for JavaScript. Just use the EMBED tag, and set the autostart attribute to "true". The wav file will start playing as soon as the page is loaded.
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Thanks Paul.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60764
    
  65

Moving to the HTML/Javascript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Play .wav in Jsp
 
Similar Threads
Audio Problem
Play sound in Applications
how to clear user cache?
how to add wav file in jsp
Play .wav in Jsp