Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | Java | Q4049 [ previous next ]

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

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.