I have a C program generating Morse code, written by Tom Russo KM5VY around 1999, modified to include include a few extra characters and cater for the anomaly of things like short breaks “ii” that need the inter character space to be unweighted when the character speed and word speed (Farnsworth weighting) are dissimilar. Normally the output goes to a user selected .au file - an early Sun sound format that will happily play via Real Player in a small window.
I would like to use the program from the command line and wish to transmit the program output directly directly as tone modulated CW on an FM transmitter for operator training purposes. I can presently queue a Bourne shell script to call the program which also redirects the output to /dev/audio or less satisfactorily to /dev/dsp.
The problem I have is that the sound card is working at full volume with no control of the audio level. I would need to use a simple resistor divider to adjust the signal, but would like to be able to control the sound card volume, either by piping through a digital attenuator/filter and on to /dev/audio or redirection to an application that will render the output correctly, hopefully with some form of volume control setting/configuration.
Code:
( morse 20 20 800 < messagedata.txt > /dev/audio )
The parameters to morse are character speed, Morse speed and tone
is there a way that I may redirect the audio data (.AU formatted) to a simple sound application that can be called from the command line and that will quietly die at the end of the file/data stream?
Alternatively, I suppose that it should be possible to write a small C program to take stdin, work on the numbers and pass the modified stream of values back out to std out.
Code:
( morse 20 20 800 < message.txt | FILTER > /dev/audio )
I understand that the .AU format, being one of the early ones, is very simple and straight forward. I suspect that the header information is presently responsible for a slight click in the audio at the beginning of the stream, but optionally removing the generation of the .snd header would I believe leave me with numeric representation of audio samples that might be amenable to simple experimentation.
My early research however suggests that I am a naif, but about to find out a lot about codecs and digitally compressed audio data. So no free lunch then.
The best direction to take is
probably almost as good as a ready made answer to my problem.
Thanks for reading.
PAix