This is a kit for generating and interpreting DTMF tones.
It should still be regarded as beta quality,
but it seems pretty robust in practice.
The library includes the facility to encode JSON in the audio output,
encoded as DER-encoded ASN.1.
Building it requires libmad, which is available from
To build, unpack the tarball and:
$ ./configure --with-libmad=/path/to/libmad $ make $ make check $ make install
If you're building from a checkout, precede that with
(you must have libtool, automake and autoconf installed).
$ dtmf2hex [options] [filename]
...reads DTMF tones from an MP3 or WAV file, displaying them as bytes
or JSON; it can read MP3s from stdin.
$ hex2dtmf [options] [message]
...converts a sequence of bytes, or JSON, to a WAV file.
See src/c/dtmf2hex.1 and src/c/hex2dtmf.1 for manpages.
Currently, the WAV support is implemented only for little-endian
(eg Intel-based) machines.
These two utilities are interfaces to a small
This isn't currently documented other than by example, in the
hex2dtmf.c and dtmf2hex.c sources.
example in that directory.
JSON and ASN.1/DER
Because the library can now parse JSON and encode it in the DTMF,
encoded as DER, this package includes a JSON to ASN.1/DER
encoder/decoder. This uses the Jason library.
In that encoding, JSON primitives – integers, floats, booleans, and null –
are encoded to their DER analogues. A JSON array is encoded to a DER
SEQUENCE, an object to a
SET OF two-element sequences, and strings
Copyright and Licence
The program is copyright 2012–13, Norman Gray http://nxg.me.uk.
It is distributed under the terms of the GNU General Public Licence,