A simple way to play a file in an Application  
Author Message
Steve Kostoff





PostPosted: 2003-10-19 10:01:00 Top

java-programmer, A simple way to play a file in an Application Hi all,

I am looking for a simple way to play a sound clip (.au file) in a java
application (not applet). AudioClip in java.applet seems to require URLs for
clips, and the Java Sound API looks a little too elaborate for what I am
trying to do. All I need is for this .au file to be played once inside
another method. Can anyone give me some pointers here?

TIA


 
Digby





PostPosted: 2003-10-19 20:23:00 Top

java-programmer >> A simple way to play a file in an Application I'm not sure that this applies in your case,. but don't forget that a file's
URL is file://path:/to/file.name.

"Steve Kostoff" <email***@***.com> wrote in message
news:Abmkb.94709$k74.38154@lakeread05...
> Hi all,
>
> I am looking for a simple way to play a sound clip (.au file) in a java
> application (not applet). AudioClip in java.applet seems to require URLs
for
> clips, and the Java Sound API looks a little too elaborate for what I am
> trying to do. All I need is for this .au file to be played once inside
> another method. Can anyone give me some pointers here?
>
> TIA
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.525 / Virus Database: 322 - Release Date: 09/10/2003


 
Steve Kostoff





PostPosted: 2003-10-20 4:13:00 Top

java-programmer >> A simple way to play a file in an Application
"Roedy Green" <email***@***.com> wrote in message
news:email***@***.com...
> On Sat, 18 Oct 2003 22:00:55 -0400, "Steve Kostoff"
> <email***@***.com> wrote or quoted :
>
> >AudioClip in java.applet seems to require URLs for
> >clips, and the Java Sound API looks a little too elaborate for what I am
> >trying to do.
>
> see http://mindprod.com/jgloss/sound.html It includes sample source to
> generate a sound file and play it programmatically.

Thanks Roedy, I was inspired by your example and that did the trick. I used
a FileInputStream for the File object for the .au sound file, and used that
in the player. It worked - thanks again.

Cheers,
Steve