player.class demo
This is a demo of player.class, a simple Java class that allows Audio files to be played within web pages, and controlled by the user with a simple pause/play control. The AudioClip can be played as a single shot or in a loop, and can be configured to play automatically when the page loads, or to wait for the 'play' button to be pressed.
When using Netscape 2.0, it's possible to play two files concurrently, though I've not had a chance to try this with other browsers yet.
The operation of the applet is controlled using the following parameters:
- au_file
The URL of the file to play. This can either be relative to the URL of the HTML file, or absolute. Note that the only format supported (to my knowledge) across all Java platforms is 8-Bit Mono, 8000 Samples/Sec .AU files. Two utilities suitable for converting from other formats (e.g. .WAV) to .AU are Goldwave and Cool Edit.
- init
Indicates whether to play the file immdeiately the page is loaded. a value of "PAUSE" will stop the file playing until the user presses the play button. Any other value will result in the AudioClip playing immediately.
- loop
Indicates whether the file should be played once, or in a continual loop. Valid valies are "YES" and "NO", with a default of "YES".
- playtime
Indicates how long the file is in milliseconds. This parameter is required if loop="NO", as it is used to determine when the AudioClip has finished playing. It will default to 1 second, though a warning will be issued via the Java Console if not specifed. It has no effect, and is not required, if loop="YES".
player.class is freeware, though I'd appreciate a credit from any website where it's used. A link to my home page, java page or my mail address would be welcome.
If you've got any questions, queries, comments or suggestions re player or Java, please don't hesitate mail me.

[Last updated 24-Feb-96 ]