Coder Social home page Coder Social logo

gbonacini / dtmflib Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 518 KB

A library to generate DTMF tones, convert file in DTMF sequences. Include cmd line tool.

License: GNU General Public License v2.0

C++ 83.67% Shell 16.33%
dtmf dtmf-tones cpp cpp14 linux

dtmflib's Introduction

Description:

This library permits to produce DTMF ( https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling ) tones using Alsa lib and a sound card under Linux and can encode standard file ( text or binary data) in a DTMF tones sequence.

Trivia:

I intended to use it for radio hacks / experiments. Then I watched Bandersnatch ( https://en.wikipedia.org/wiki/Black_Mirror:_Bandersnatch ) and I felt the necessity to try, in 2019, the experience ( read "the pain") of saving a file on audio cassette. So I added a command line tool based able to convert a file (binary or text ) in a sequence of DTMF tones There are 16 DTMF tones, so you can covert a byte in a sequence of two DTMF tones, one encoding the four most significative bits, the other the less significative. For now, the speed is 4 tones for second, so 2 bytes for second. Definitely it's slower than a C64 cassette player ( 300 byte per second, if I remember), but ITU specs show that the speed should be improved drastically, maybe in the future I'll do some changes ( suggestions are welcome ), for now I think it's awesome, so 80s (maybe 70s) !

DISCLAIMER:

This code has been posted for information and educational purposes. The intrusion in systems and services without the owner's authorisation is illegal. The misuse of the information and the software in this repo can result in criminal charges brought against the perpetrator of the crime. Any actions and or activities related to the material contained within this Git Repository is solely your responsibility. The author will not be held responsible in the event any criminal charges be brought against any individuals misusing the information or the software in this website to break the law.

Prerequisites:

The program is intended to be used in a Linux environment and it is tested on various Linux distributions:

  • Ubuntu 18.04.1 LTS

using, as compiler, one in this list:

  • gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)

This program needs Alsa library.

Installation:

  • launch the configure script: ./configure
  • Compile the program: make
  • Install the program and the man page: sudo make install

Instructions:

  • Produce a sequence of DTMF tones: ./src/dtmf -s "1 1 1" spaces are pauses.
  • Convert a file (binary or text) to a file DTMF encoded: ./src/dtmf -b ./test/dtmf.bintest -o./xxx dtmf.bintest is the original, xxx the destination.
  • Decode the previous file: ./src/dtmf -t./xxx -o./dtmf.bintest.again
  • To "play" an encoded file, you can pass it on stdin: cat xxx | ./src/dtmf maybe you want save it on a cassette recoder! :-)

Documentation:

Man pages and examples are present in the distribution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.