[3480] in java-interest

home help back first fref pref prev next nref lref last post

Re: Audio in a standalone application

daemon@ATHENA.MIT.EDU (Suresh Srinivasan)
Tue Nov 14 14:00:39 1995

Date: Tue, 14 Nov 1995 10:34:54 -0500
From: suresh@thomtech.com (Suresh Srinivasan)
To: java-interest@java.sun.com
Cc: robert+@andrew.cmu.edu

> 
> I've been trying to play audio clips in a standalone Java application
> with little success. It seems the only possible way to do this without
> using anything in the sun.* tree would be to import java.applet.* and
> then do something like:
> 
> play(new URL("http://site.com/soundfile.au"));
> 
> or
> 
> AudioClip clip = new AudioClip;
> clip = getAudioClip(new URL("http://site.com/soundfile.au"));
> clip.play();
> 
> Neither of these work, I get errors that Java cannot find getAudioClip()
> and play(). How might I go about doing this? Thanks.
> 
> robert
> 

Ensure that the URL is the right one and the audio file is there.
I think play() returns silently if the URL is bad.

Then make sure that you've imported all the right classes.
I think you'll need:

  import java.applet.Applet;
  import java.applet.AudioClip;

There's a trivial example I have that works and might help at:
http://www.thomtech.com/~suresh/java/beta/GuitarMusic.java

Else, show us the exact error message you're getting.

Cheers,

--Suresh
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post