The NanoGong Applet Being Accessed via the Gong API

Record Level:
Time:
└ 0 second
-
Speed: Slow Normal Fast

This example is created using a NanoGong applet which is not displayed on the webpage. The applet is hidden visually in the page but it remains working in the background.

There are four buttons on this webpage. All these buttons will run some JavaScript code which then communicate with the NanoGong applet. Pressing the 'Record' button will start the recording of a new voice message. To stop the recording the user is required to press the 'Stop' button. The recording is started by calling a JavaScript function called 'gongRecord' in the 'gong.js' library. The recording is finished when another functions 'gongStop' is used. To playback the recorded voice the user can press the 'Play' button. Finally the 'Save' button allows the user to save the recorded voice to a file on the hard disk.

There are also three radio buttons for controlling the playback speed of the voice. It is achieved by calling a function called 'gongSetRate' to adjust the playback rate (speed) of the NanoGong applet.

The following is an extract of some of the JavaScript and HTML used on the page.

...
<script type="text/javascript" src="gong.js"></script>
<script type="text/javascript">
<!--
    ...

    function record() {
        ...
        gongRecord(document.getElementById("nanogong"));
        ...
    }

    function stop() {
        ...
        gongStop(document.getElementById("nanogong"));
        ...
    }

    ...
// -->
</script>
...
<input type="button" value="Record" onclick="record()" />
<input type="button" value="Stop" onclick="stop()" />
...
<applet id="nanogong" ...>...</applet>
...