|
|
Playau
This java applet will play a .au sound and can animate a picture while
the sound is playing. My default picture is a speaker that vibrates as
the sound is played. But you can draw your own picture that does
anything you want (say, like a dancing girl). Okay, here is the applet:
Click here to hear a sound-->
Try
this
one-->
The source code
Here are all of the possible parameters. Only the first two ("sound"
and "playtime") are required, the rest just allow you to customize
things.
<applet code="playau.class" width=25 height=15>
<param name="sound" value="sounds/ohlover.au">
<param name="playtime" value=5>
<param name="imgstrip" value="playau.gif">
<param name="numframes" value=4>
<param name="framedelay" value=200>
<param name="autoplay" value=1>
</applet>
What they mean:
sound - name of the sound file (must be a .au) to play playtime - number of frames to show, controls how long the image is animated. imgstrip - Image strip with the frames to show (default=playau.gif) numframes - number of frames in the image strip (default=4) framedelay - delay time between each frame (default=200ms) note: changing this affects the playtime parameter autoplay - 1=play sound as soon as applet starts (default=1) 0=wait until mouse clicked to play the sound
If you want to draw your own picture, it must be made up of frames like
this:

Notice how the background is gray? You can use a graphics editor to
change the gray to match your background. If you draw a completely new
picture, be sure to pass the number of frames and the name of your
image.
Hint:
When creating your .au sounds they must be 8-bit,mono at 8000Khz. Go
to www.spies.com/Sox
to
get a DOS utility called sox to convert .wavs to .au at the proper freq. Use the
command "sox.exe file.wav -r 8012 -U -b file.au" to create to java
playable .au file. You can also get it here if that site does not work.
Download playau.zip
(contains
playau.class,playau.gif,playau.java)
|