Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

5 Commits

Repository files navigation

OpenTone

DTMF encoding/decoding

Install

pip install opentone

Usage

Here is a clone of GoogleTone

fromopentoneimportToneGenerator, ToneDecoderimportpyshortenersaspyshortdeftiny_link(url):
tinyurl=pyshort.Shortener().tinyurl.short(url)
# The consant prefix in the TinyURL is standard and can be# removed altogether, and added in the receiving stationURL="http://tinyurl.com/"url=tinyurl[len(URL):]
returnurlurl="https://hellochatterbox.com"url=tiny_link(url)
wave_file="chatterbox_encoded.wav"tone_gen=ToneGenerator()
tone_gen.encode_to_wave(url, wave_file)
decoder=ToneDecoder()
decoded_url=decoder.decode_wave(wave_file)
assertdecoded_url==urlprint("http://tinyurl.com/"+decoded_url)

NOTE: Input wave files should be 8khz mono

convert files with

ffmpeg -i some_file.mp3 -acodec pcm_s16le -ac 1 -ar 8000 out.wav

About

send data by audio encoded in DTMF tones

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages