AudioBox
Press a button to play a sound. Sounds will composite when overlapped. Important: when running within Navigator on a local computer, it may be necassary to wait one or two
minutes until the status bar indicates that the java applet is running before pressing the form buttons.
This applet is a slick example of using JavaScript to communicate with an applet. It's fast, easy to use, and still allows the user to control the experience.
Usage: Download the zip file containing the class file and an example page, along with two example audio clips. Unzip it into one directory, and follow the instructions on the example page.
Java Source: Not available.
HTML Source:
<applet code="AudioBox.class" name="AudioBox" width=5 height=5>
</applet>
<form>
<input type="button" value="Sonar" onClick="playAudioClip('sonar.au')">
<input type="button" value="Babam" onClick="playAudioClip('babam.au')">
</form>
JavaScript Source:
<script language="javascript1.1">
<!--
//This function tells the AudioBox applet to play a sound
function playAudioClip( sAudioURL )
{
if ( (navigator.javaEnabled != null) &&
(navigator.javaEnabled()) )
document.AudioBox.playSoundtrack( sAudioURL );
}
//-->
</script>
Author: 1Automata
|