Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Java in General and the fly likes Audio Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Audio Problem" Watch "Audio Problem" New topic

Audio Problem

J Cleary

Joined: Mar 24, 2006
Posts: 13
Hello, i am looking for how to play wav files in a java application please?
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2398
One way is by using the method newAudioClip in java.applet.Applet
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

The Java Media Framework (JMF) is what you need to use. The applet sound capability doesn't work outside of a browser or appletviewer, and support for various formats is extremely spotty.

[Jess in Action][AskingGoodQuestions]
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2398
I agree the Java Media Framework is better, but they did add a static method called newAudioClip to the Applet class that gives you some support for audio outside of an applet.

I agree. Here's the link:
subject: Audio Problem
It's not a secret anymore!