FeaturesThe files can be any mixture of AU, AIFF, MIDI or WAV files. It allows independent control of both stereo channels for some interesting 2D effects. Here is a snap-shot of Gecho.
![]() There are volume controls for both stereo channels and a display of the file being played. The state of the controls can also be controlled from Java and JavaScript for added visual feedback (for example, the "play" button will appear to be pressed when the plugin's "play" method is called from Java or JavaScript). |
tar xvfz Gecho.gzThis will make a directory called 'Gecho'.
make installwill copy three files ( gecho.so, Gecho.class and FadeGecho.class ) into the directory
/usr/lib/netscape/plugins/Alternatively, (if you are not the root user, or if you want Gecho to be local to your Netscape) by changing 'INSTALL_DIR' in "Makefile" before typing 'make install' you can install them in
~/.netscape/plugins/You will need to re-start netscape and hopefully everything should work perfectly! (Note that to play MIDI files you'll need timidity - see below). You can test out Gecho on my test files.
(Note - If you are using RedHat Linux version 5.x the
binaries should work right away.
I don't know if the binaries will work with other versions of Linux - if
not, you'll need to re-compile the source code (see below) - sorry!).
If Gecho doesn't work, check that it is enabled for all the MIME-types AIFF, AU, MIDI and WAV. Do this by going to the "About Plugins" page under the "Help" menu on Netscape. If Gecho is not enabled, go to the Netscape Applications page by choosing "Edit" - "Preferences" - "Navigator" - "Applications". Then find the above MIME types and make sure the Gecho plug-in is selected for them. Note that audio/wav and audio/x-wav both refer to files with the .wav suffix.
You'll need to change the definitions of 'SDK' and 'JDK' in Makefile to point to your SDK and JDK directories, then just type 'make' and it should re-compile the Java and native C code.
If it does compile and run properly I would appreciate a copy of the binaries so I can include them here - thanks.
Timidity converts MIDI files to WAV format files which can then be played on almost any sound card. Timidity was originally written by Tuukka Toivonen and though his page is now not being maintained by him it still contains useful links.
I have included a version of timidity (which should run on RedHat Linux 5.x) in the Gecho.gz file you just downloaded. You can copy timidity into '/usr/local/bin' (as well as a cut-down sample of patch files into '/usr/local/lib/timidity/patch') by simply typing
cd timidityand then
make installRead the README file if you want to put the files somewhere else.
When Gecho is presented with a MIDI file it calls Timidity which converts the MIDI file to a WAV file, which Gecho can then play and mix with other sounds. Timidity may take a while to convert a file, so you will notice a pause of a few seconds before Gecho plays the converted MIDI file. Timidity needs a set of "patch" files which contain the wave shapes of all the instruments needed. This full set of patch files takes up about 7 MB (though the selection I have included is much shorter).
If the binary code I mentioned above doesn't work for you, you can get a version of timidity from Vincet Pagel's timidity page, or search the web a bit.
If you want the full set of patch files (I really recommend getting them), you need to put them in the directory '/usr/local/lib/timidity/patch'. I got my patch files from Fredrick Hubinette's Plugger page (which, by the way, I recommend if you want a general purpose plug-in to deal with lots of different kinds of files).
The sound files will take a few seconds to download, so don't worry if you don't hear anything right away. When the file is loaded, its name should appear in the plugin window.
Moving over CP3O should play a "2D" sound on the left plugin - watch the volume controls.
"Pause All" will pause all the sounds while "Stop All" will... stop all the sounds. However, "Play All" will only re-start the paused sounds - it will not play anything if nothing has been paused.
If everything works you may want to take a look at the page source to see
how it is done.
In order to play sounds on your web page you have to embed a Gecho plugin in it. You do this with the command
< EMBED
NAME="name" an optional name for the plugin
so that you can refer to it from
SRC="URL or file" (must have a suffix aif,aiff,mid,
midi,wav,au or snd)
TYPE="MIME type" (eg. audio/basic - if SRC is not
included you'll need this to get
a Gecho plugin).
COLOR="color" (eg. red - default is lightblue)
AUTOSTART="{true or false}" (starts playing right after loading)
WIDTH="int" a number - 150 is good
HEIGHT="int" a number - 70 is good
DISABLED="{true or false}" if true, console can be enabled later
using the method "enable()"
HIDDEN="{true or false}" hides the plugin console
LOOP="{true or false or int}" infinite loop, single play, or a certain
number of loops.
>
For example,
< EMBED SRC="sound.wav" color="blue" width=150 height=70 autostart=false loop=true > or < EMBED src="http://www.noise.com/sounds/bang.au" autostart=true > or < EMBED type="audio/midi" width=120 height=70 >
The methods are
| play(loop,url) | eg. play(true,"sound/boing.au") - loops endlessly or play(false,"http://www.noise.com/tune.midi") - plays once or play(3,"hey.wav") - plays 3 times. |
| play(loop) | plays the sound file last loaded - 'loop' is as described above. |
| stop() | stops the plugin playing. |
| pause() | pauses the plugin |
| setvol(vol) | where 'vol' is an integer from 0 to 100. Sets both stereo channels to 'vol' |
| setvol(leftvol,rightvol) | sets volumes for left and right speakers, again from 0 to 100 |
| fade_to(vol) | fades left and right channels to 'vol' over a time of 3 seconds |
| fade_to(leftvol,rightvol) | fades left channel to 'leftvol' and right channel to 'rightvol' over 3 seconds |
| fade_to(leftvol,rightvol,time) | fades left channel to 'leftvol' and right channel to 'rightvol' over 'time' seconds |
| disableConsole() | disables the console controls |
| enableConsole() | enables the console controls |
| stopAll() | stops all playing plugins |
| pauseAll() | pauses all playing plugins |
| playAll() | re-starts all plugins which have been paused |
| IsPlaying() | returns true when plugin is playing |
| IsPaused() | returns true when plugin has been paused |
| IsStopped() | returns true when plugin has been stopped |
| IsReady() | returns "true" when sound file has been uploaded |
| GetVolume() | returns the average of left and right volumes |
These methods are called by prefixing them with "document.embeds[n]." where 'n' is the number of the plugin in the web page (starting with 0).
eg. document.embeds[0].play(3,"sound.wav") would play "sound.wav" three times on the first plugin.
More detailed information on calling plugin methods from JavaScript and Java can be found on Netscape's Client-side JavaScript Guide, or you can take a look at the source for this page (hold "shift" down and click to download).
I use RedHat Linux 5.1 and have a SoundBlaster card, and I couldn't get the Java method "play" to work in my Java applets on Netscape, though they did produce sounds in the appletviewer. This was annoying because they did work with Internet Explorer, and I liked the ability to play many sounds at once.
Then when I read about the Netscape Live-Audio plug-in I thought NOW I could produce noisy web pages.... until I eventually realised it wasn't shipped with the Unix/Linux versions!
Then I at last bit the bullet and downloaded the Plugin SDK from Netscape
And that was the start of my troubles.....