[4525] in java-interest
I've got the AudioClip blues
daemon@ATHENA.MIT.EDU (John D. Kane)
Thu Jan 4 21:34:44 1996
From: "John D. Kane" <john@insightnews.com>
To: "' java@java.sun.com'" <java@java.sun.com>,
"'java-interest@java.sun.com'" <java-interest@java.sun.com>,
"'jug@solect.com'" <jug@solect.com>
Date: Thu, 04 Jan 96 20:05:00 PST
I can use MediaTracker for my images, but as far as I know, nothing yet
exists along these lines for AudioClip's. I remember reading somewhere that
MediaTracker should work for sounds too, but I don't see it in the JDK 2
yet.
What I want to do is want for a key click sound (for a logo which is
displayed like a typewriter is typing it). I've tried both the
'play("SoundName")' and 'SoundName.play()' methods but neither downloads the
sound to the client. It appears both just receive a handle to the sound and
the sound is downloaded whenever a 'play()' method is first called. Of
course by this time, two letters have appeared on the screen without any
sound. The rest of the letters sound good once the sound is there.
Sound options and methods seem to be quite limited compared to the rest of
the java classes. I think I've tried all the "normal" possibilities, but if
anyone else knows of another method, please let me know.
Actually, one more idea just occurred to me, but I'm leaving work now. I
know it's possible to download an object from the server to the client using
the URL and URLConnection classes along with methods such as getContent() to
get the contents of the URL. I've just recently done this with a text file.
It was returned as type Object so I just type-casted it into a
DataInputStream object and used readLine() to get each line of text from it.
Which brings me to wondering ... is it possible to download a sound from
the server by the same means and then type-cast it as an AudioClip? Has
anyone else tried this? -- please let me know how it turned out if you did.
I think this is the last possible line of action I can think of.
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com