Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q4049 How do I add an audio file to an applet (or application) without using an URL?

You are here: irt.org | FAQ | Java | Q4049 [ previous next ]

It is not possible to add an audio file to an applet or application without using URL.

AudioClip interface is defined in java.applet package, and java.applet class has method getAudioclip(URL...) to get the audio file. This is a public method, so even if you override it, your implementation will also have some url or path which you will need to reach the audio file in your applet or application.

The following was submitted by Simon

Try grouping the audio clip together with the class file all in one JAR file, if this works then it will reduce the download time required as the JAR file is sent in one go, and will therefore cause just one HTTP request rather than a request for each file. More time can be spent processing requests than actually downloading files.

Feedback on 'Q4049 How do I add an audio file to an applet (or application) without using an URL?'

©2018 Martin Webb