Saving Morse Code Audio to a File

Many people ask if they can save the morse code sounds to audio files on their computers.

I added a "Save" button to do this, but it generally doesn't work.

The problem is the security restrictions placed on Java applets. Java applets come from a web server but they run on your computer. In order to protect your computer from being damaged by malicious applets, all applets run in a "sandbox", from which it is normally impossible to modify your computer in any way, even if you click on the "Save..." button. This is a good thing; it makes it safe to view web pages containing applets written by people you do not know or trust.

The designers of Java and the web browser applet mechanism tried to make it possible to run signed, trusted, applets that would be allowed to escape the sandbox to do useful things like save a file. But they didn't do a very good job. There are four different schemes for building a signed applet, and none of them work on most Java-enabled browsers. To make my Java Morse Code applet work on most Java-enabled browsers, I would have to get four different sets of Java tools and run each one of them every time I made a change to the program. I would also have to publish several certificates, and several different sets of instructions for the users of different browsers on how to install my certificates in their browsers and configure them to allow this applet to save a file. It's just more work than I'm willing to do.

If you use Microsoft Internet Explorer 5.0 or later you can use that browser's security controls to place my web server in a special "zone" and give that zone's unsigned content the privileges to display dialogs and to write to files. Then you can run my applet and use the "Save..." button. But if you do this you are opening up vulnerabilities on your computer. If someone, somehow, installs a malicious Java applet on my web server, it would normally be harmless because it would run in a sandbox, but your computer would have been told to let applets from my server have control of your computer... and bad things would happen.


Back to the morse code practice page