User Tools

Site Tools


morsecode

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
morsecode [2026/05/05 14:32] frchrismorsecode [2026/05/05 14:40] (current) frchris
Line 3: Line 3:
 ==== ToneTester ==== ==== ToneTester ====
 This demonstrates how to generate a morse code tone. The timing is all based on the length of the "dit" This demonstrates how to generate a morse code tone. The timing is all based on the length of the "dit"
 +
 +ToneTester demonstrates how to use the javax sound
 + library to generate a morse code "CQ CQ"
 + which is what a HAM radio operator will
 + call to seek out a conversation from
 + anyone who might be able to be listening
  
 <code java ToneTester.java> <code java ToneTester.java>
- 
 import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioSystem; import javax.sound.sampled.AudioSystem;
 import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.SourceDataLine;
- 
  
 public class ToneTester { public class ToneTester {
Line 42: Line 46:
  int[] c = {dah, di, dah, dit};  int[] c = {dah, di, dah, dit};
  int[] q = {dah, dah, di, dah};  int[] q = {dah, dah, di, dah};
 + int[][] cq = {c,q};
  for (int i = 0; i < 2; i++) {  for (int i = 0; i < 2; i++) {
- play(c); + playWord(cq);
- play(q);+
  }  }
  
morsecode.1778005940.txt.gz · Last modified: by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki