[4850] in java-interest
No subject found in mail header
daemon@ATHENA.MIT.EDU (Roger Brinkley)
Tue Jan 16 18:27:16 1996
Date: Tue, 16 Jan 1996 11:47:57 -0700
From: Roger.Brinkley@Central.Sun.COM (Roger Brinkley)
To: java-interest@java.Eng.Sun.COM
I've run into a problem with audio that hopefully someone in Java engineering
can answer. I've searched various databases and found this question has been
asked before but no one has an answered the question.
It appears that AudioClips can only be fetched (getAudioClip) if your class is
a subclass of an Applet and your running some type of browser or viewer. Stand
alone applications get a NULL exception handler on getDocumentBase or
getCodeBase. Additionally, audio can only be played in the main Applet
instance. You can play audio in other classes but you have to pass the main
Applet down the chain of constructors.
Images use to have this same problem, but the last version of beta corrected
it by putting a method in Toolkit for loading images. I believe there are two
bugs:
1. You can't load a sound into a stand alone application.
2. You can't load a sound into a class other than the main Applet
instance.
Are these bugs?
Are there any workarounds?
In a related issue, I'd like to see some base point made available in both
applets and stand alone applications to facilitate the fetching of images and
audio from a common location. Something very similar to getCodeBase but
available in the Toolkit. getCodeBase works fine if your in the main Applet
instance and running as an Applet, but fails otherwise. In the current beta
version I can get the code base from the main Applet instance (I have to pass
it down the chain of constructors), but I have to specify the file path in the
stand alone applications to fetch images files (audio files don't work in
stand alone apps).
A common base point method for either applets or stand alone applications
would allow flexibility to run the same code as an applet or application.
Binky
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com