113 lines
4.0 KiB
HTML
113 lines
4.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta name="GENERATOR" content="mkd2html 2.1.5a DL=DISCOUNT">
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
|
<link rel="stylesheet"
|
|
type="text/css"
|
|
href="../hint.css">
|
|
<title>Best handling of beeps</title>
|
|
</head>
|
|
<body>
|
|
<h1>Best handling of beeps</h1>
|
|
|
|
<p>Daniel Vik<br>
|
|
<a href="mailto:daniel@vik.cc">daniel@vik.cc</a><br>
|
|
<a href="http://danielvik.com/">http://danielvik.com/</a></p>
|
|
|
|
<h2>Judges' comments:</h2>
|
|
|
|
<h3>To build:</h3>
|
|
|
|
<pre><code>make
|
|
</code></pre>
|
|
|
|
<h3>To run:</h3>
|
|
|
|
<pre><code>./prog > foo.c
|
|
</code></pre>
|
|
|
|
<h3>Try:</h3>
|
|
|
|
<pre><code>echo 'Want to hear me beep?' | ./prog > audio_file.raw
|
|
|
|
echo 'No. I want chocolate!' | ./prog | mplayer -demuxer rawaudio -
|
|
</code></pre>
|
|
|
|
<h3>Selected Judges Remarks:</h3>
|
|
|
|
<p>This program sets a new tone for obfuscation. But do you understand
|
|
what it says about obfuscation? Perhaps:</p>
|
|
|
|
<pre><code>./prog < prog.c > prog.raw
|
|
</code></pre>
|
|
|
|
<p>might speak to your coding style? If not, then perhaps:</p>
|
|
|
|
<pre><code>./prog < remarks.markdown | mplayer -demuxer rawaudio -
|
|
</code></pre>
|
|
|
|
<p>might help? :-)</p>
|
|
|
|
<h2>Author’s comments:</h2>
|
|
|
|
<h3>Remarks</h3>
|
|
|
|
<p>This program converts ascii text to morse audio file and vice versa. As far as
|
|
I can tell, there are at least six chocolate references in this program.</p>
|
|
|
|
<p>This program can convert text to morse to a raw 44.1kHz stereo audio file.
|
|
Via streaming to mplayer, you can listen to the morse audio.</p>
|
|
|
|
<p>Don’t forget the last ‘-’ as it makes mplayer read from stdin.)</p>
|
|
|
|
<h2>Convert audio file with morse signals to text</h2>
|
|
|
|
<pre><code>$ ./prog e < audio_file.raw
|
|
</code></pre>
|
|
|
|
<p>or alternatively pass a .wav file as input.</p>
|
|
|
|
<p>The preferred input format 44.1kHz stereo, but it does a decent job on mono
|
|
input and different frequencies as well.</p>
|
|
|
|
<h3>Portability</h3>
|
|
|
|
<p>The program is portable to most platforms. The only system dependency is that
|
|
the program relies on writing binary data to stdout.</p>
|
|
|
|
<p>Microsoft compilers adds a carriage return to newlines, and to compile the
|
|
program with this platform, the following line can be added after the main
|
|
declaration in order for the program to run correctly:</p>
|
|
|
|
<pre><code>_setmode(_fileno(stdout), 0x8000);
|
|
</code></pre>
|
|
|
|
<h3>Known Issues</h3>
|
|
|
|
<p>The program uses a quite simple algorithm for detecting tone on and off events
|
|
in the morse signal. Hence the program does not work well with noisy input
|
|
signals. I have tested it with several samples of man made morse recordings as
|
|
well as computer generated ones.</p>
|
|
|
|
<p>Generally, any recording from ham radio transmissions does not decode due to
|
|
noise and echoes. Other man made recordings may decode, but some characters
|
|
can be incorrect due to too big variation in length of tones and pauses.
|
|
However I found some man made recordings on that decode reasonable well.</p>
|
|
|
|
<p>If a recording don’t decode, you could try to pre-process the input with a
|
|
narrow bandpass filter on the frequency of the transmission.</p>
|
|
|
|
<hr />
|
|
|
|
<TABLE><TR>
|
|
<TD><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a></TD>
|
|
<TD><P>© Copyright 1984-2015,
|
|
<A HREF="/judges.html">Leo Broukhis, Simon Cooper, Landon Curt Noll</A>
|
|
- All rights reserved<BR>
|
|
This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</P></TD>
|
|
<TD> <!--<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>--></TD>
|
|
</TR></TABLE>
|
|
</body>
|
|
</html>
|