MumboJumbo 0.1 beta Readme (original) (raw)
- What is MumboJumbo?
- Download
- Installation and Use
- Examples
- Understanding the source code
- To do list
- Thanks
What is MumboJumbo?
MumboJumbo is a Java applet that is capable of playing sound files. It is useful when you don't want your users to have to download a special plugin to play sound files that you would like to use in your page. You simply specify the sound file to be played as a parameter to the applet.
MumboJumbo could be used:
- to play voicemail messages in systems following the Internet Voice Messaging standards, being developed by the Voice Profile for Internet Mail group.
- to add sound effects to your web pages. These effects can either be played automatically when the page loads, triggered by HTML buttons, or started using Javascript commands. The applet plays sound by first converting the file to an 8 bit, 8Khz, Ulaw stream. The JVM supports this sound format natively, so the Ulaw stream is sent to an internal audio player. At this point the supported formats are:
- WAV, PCM, 8-bit, 8khz, Mono
- WAV, PCM, 16-bit, 8khz, Mono
- WAV, GSM 6.10
- Raw GSM
- Raw Ulaw, 8bit, 8khz I'm adding to this admittedly short list of supported formats as time permits. If you have a format that you would really like to see here, write to me and let me know.
MumboJumbo runs in one of three different modes:
- Console mode: In this mode you will see a play and a stop button, which do the obvious. You can also turn on Autoplay in console mode, and the sound file will play as soon as the page loads.
- Hidden mode / Autoplay on: In this mode there are no buttons, and the sound file will play as soon as the page loads, as there are no buttons to start playing the sound.
- Hidden mode / Autoplay off: Again, there are no buttons, however the sound doesn't play. Zoiks!? How do you play the sound? You can use Javascript messages to send play and stop messages to the hidden applet. Look at the example to see how this is done.
The zip file contains the following:
File / Directory | Description |
---|---|
Readme.html | This file. |
index.* | Examples showing how to use MumboJumbo. |
classes/ | Contains all the Java packages and source code for MumboJumbo. |
samples/ | Sample wav files that demostrate the capabilities of this applet. |
Makefile | Used to compile all the source code. |
Download
You can download MumboJumbo from the projects sourceforge page.
Installation and Use
Move the MumboJumbo directory to a place where it is accessible from your web server. The sound files that you want to play should also be accessible from the same webserver.
In your HTML file add an applet tag like this:
The codebase should be a valid reference to where you installed the applet.
The width and height values will determine the size of the console if it is turned on. Normally, if the console is turned off, i.e., you don't want to see the Play/Stop buttons, then you should set the height and width values to 0.
The soundfile parameter should refer to a valid file in the supported format.
The mode parameter can be either "console" (default) or "noconsole".
The autoplay parameter can be either "true" or "false" (default).
See the examples section for more details on using this applet.
Examples
- WAV, PCM, 8bit, 8khz, Mono, with a console
- WAV, PCM, 16-bit, 8khz, Mono, no console, autoplay on.
- WAV, GSM 6.10, with a console
- Raw GSM, with a console
- Javascript example, showing how you can interact with the applet using Javascript.
Understanding the source code
This is for those of you who would like to read or modify the source code:
All the source is in the classes/ directory. There are three packages in this directory:
package com.voxeo.mumbojumbo: Contains the applet, a Utility class, and a TriggerWatcher thread class. The TriggerWatcher exists to listen for Javascript calls. This thread was necessary because of what seems to be a bug in both IE and Netscape browsers. In either case, if the Javascript function directly called the playAudio() function in the applet, the browsers would catch this as an access violation. Instead, if the Javascript function only called a function in the applet which set a flag or a trigger, and a seperate thread was watching this trigger, then everything would work fine.
package com.voxeo.mumbojumbo.player: Contains the Ulaw stream player, and its supporting objects. The Ulaw player sends the Ulaw stream to an internal AudioPlayer which talks to the local sound device.
package com.voxeo.mumbojumbo.decoders: Contains the various decoders which convert the various supported data formats into a Ulaw stream. The WAVDecoder object, uses the WAVHeader object to determine the type of WAV file, and then sends the input stream to the appropriate decoder. S2U.java contains a single table that is used in converting PCM to Ulaw data.
To do List
Here is whats next on my list of things to do for MumboJumbo (roughly in order of priority):
- Compress the S2U table somehow
- Support WAV PCM data which isn't at an 8khz sample rate.
- Support more WAV formats
- Figure out how to make applet work without the TriggerWatcher
Thanks
Last but not least I owe my deepest thanks to the following people:
Jutta Degener: I ported a part of her GSM library to create the GSM decoder in MumboJumbo. Jutta was also a tremendous help in trying to debug the GSM decoding code, and her great website of GSM resources helped me a lot in understanding GSM.
Christopher Edwards: Christopher wrote the first version of this applet which was initially intended to decode raw GSM.
Francois Souchay: I'm not that thankful about it anymore, but Francois is the one who gave me my first introduction to DSP.
Written by Omi Chandiramani
while working for Voxeo Corporation