Morse Code Practice Java Applet

Technical Notes

Writing this applet using different techniques brought out some problems with Java version 1.0.2. The Morse code sound characters were originally generated using threads playing dit and dah sound files with programmed delays. It was not possible to achieve completely accurate Morse code character sounds at high speeds due the Java interpreter speed. The next best alternative was to create individual sound files for each Morse code character at a fixed speed and load them from the web site. The original version of the applet used this technique.

Instead of reading all the sound files over the Internet, it would have been better to generate the sound files within the applet's memory. Standard Java has no mechanism for creating AudioClip files in memory. However, Sun Microsystems sun.audio.io libraries provides the capability to build sound files in memory. This technique was used with an latest version of the applet. It may not work with all browsers, unless the brower supports the Sun Microsystems sun.audio.io library. The technique for using non-standard libraries for creating audio is described in an article in Java World called "How to play audio in applications", February, 1997, by Chong WerWah and John D. Mitchell. It uses the non-standard AudioStream and AudioPlayer classes.

The Morse code character sound files were generated off-line by a Java application program. Cool Edit was used to generate 800 Hz waveform dit and dah sounds in a Sun .au type file. The .au files are built in memory with the latest quick loading version of the Morse code practice applet, instead of being loaded from the Web site server.

Also lacking in Java is an audio function to determine when a sound file has finished playing. This function would have been helpful for producing Morse characters without adding time delays in the program.

The applet was originally programmed using Symantec Cafe 1.5. The latest version was developed with Symantec Visual Cafe Professional Edition and Borland JBuilder.


Back
Tekla Inc Home
More Java Applets


Copyright © 1996 Tekla Inc. All Rights Reserved