The Applet
CONCEPTS The WSAudio applet delivers direct audio streams through real-time decoding
of compressed audio files or live data. Through API functions you may also monitor and/or control its state. Read the API page for further information. This section will focus on the basic parameters.
DIRECTORIES You will need to prepare some directories on your website to let it run correctly.
- One directory will contain Java classes (let's say /applets)
- One directory will contain compressed audio files (let's say /sounds/streams)
The WSAudio applet jar file will be placed inside the /applets directory and eventually extracted with full package directory names, as found inside the jar file. What you will have is a /applets/wsaudio.jar and
/applets/com/sonicle/wsaudio directory containing the class files: THE APPLET TAG
To place WSAudio inside a page you will have to edit the HTML source and place some TAGS like these:<APPLET ARCHIVE=wsaudio.jar CODEBASE=/applets CODE=com.sonicle.wsaudio.WSAudio WIDTH=2 HEIGHT=2>
<PARAM NAME=xxx VALUE=yyy> ... </APPLET> The first line will be the same for every page that will contain WSAudio. The PARAM lines will change from page to page, depending on the features
you want to implement. Following is the list of PARAM you need or may use. BACKGROUND
- optionalYou will usually want to hide the applet visible area, defined by the WIDTH/HEIGHT tags of the APPLET tag. For this reason you will prefer to use
low values for width and height. The minimum values you can use on Netscape are 2 x 2. This means that you can't totally hide WSAudio. You can use the BACKGROUND parameter to specify an RGB color to use on
the WSAudio area, so that you can match the page color to hide the applet. SYNTAX: <PARAM NAME=BACKGROUND VALUE=r,g,b> r,g,b are the integer values representing the color.
STREAM - optional
This parameter specifies the name and location of a compressed audio file. By specifying this, the applet will automatically start this stream on startup.
SYNTAX: <PARAM NAME=STREAM VALUE=filename> filename may be any of the supported format files:
name.wsa is the new WebSynth 3 proprietary format for both 14.4 and 28.8k connections.
name.ma is WebSynth 2 high quality proprietary format for 28.8k connections [backward compatibility]. name.sa is WebSynth 2 proprietary format for 14.4k connections [backward
compatibility]. Standard GSM files, PCM WAV files, uLaw Sun Audio files, Emblaze files and Vosaic files are also supported by default. Because PCM WAV and uLaw files use minimal compression, streaming these
files over the web requires very high speed connection. Thanks to our pluggable decoder technology, you may also acquire new decoders for WSAudio, supporting MPEG1 and 2 (Layer 1,2 and 3), G723 and more.
The VALUE tag may contain a specific URL for live sessions int the form "livesession:name@machine". The typical live URL will be "livesession:default" or "livesession:default28"
meaning the default 14.4 or 28.8 live session on the default server (applet codebase host).
WAIT This parameter is helpful with file based streaming. With this parameter you may request a buffering time, useful to slow connection users.
In this case the applet will start downloading data and wait the specified amount of seconds before starting audio.SYNTAX: <PARAM NAME=WAIT VALUE=seconds>
SERVLETDIR When running a live session, the applet will automatically construct the URL to
communicate with the Servlet residing at your site. Tipically /servlet is the default servlets directory. In case your servlet engine is mapped on a different location, you may use this
parameter for the applet to construct the correct URL.SYNTAX: <PARAM NAME=SERVLETDIR VALUE=/servlet-dir>
SERVLETNAME When running a live session, the applet will automatically construct the URL to communicate with the Servlet residing at your site. Tipically
com.sonicle.wsaudio.LiveServlet is the name of the servlet. In case you created aliases of the servlet using your servlet engine administrator tool (for example to assign parameters to the servlet), you may
use this parameter to let the applet user the aliase name instead of the class name.SYNTAX: <PARAM NAME=SERVLETNAME VALUE=aliasname>
EXAMPLES The following example shows how to stream compressed audio files: <HTML> <HEAD></HEAD> <BODY> <APPLET ARCHIVE=wsaudio.jar CODEBASE="/applets" CODE=com.sonicle.wsaudio.WSAudio WIDTH=2 HEIGHT=2>
<PARAM NAME="BACKGROUND" VALUE="0,0,0"> <PARAM NAME="STREAM" VALUE="/sounds/streams/stream1.wsa"> </APPLET> </BODY> </HTML>
The following example shows how to stream a live session: <HTML> <HEAD></HEAD> <BODY>
<APPLET ARCHIVE=wsaudio.jar CODEBASE="/applets" CODE=com.sonicle.wsaudio.WSAudio WIDTH=2 HEIGHT=2> <PARAM NAME="BACKGROUND" VALUE="0,0,0">
<PARAM NAME="STREAM" VALUE="livesession:default"> </APPLET> </BODY> </HTML> |