{"id":13988858,"url":"https://github.com/ribt/dtmf-decoder","last_synced_at":"2025-07-22T09:31:36.594Z","repository":{"id":48524947,"uuid":"220832701","full_name":"ribt/dtmf-decoder","owner":"ribt","description":"Extract phone numbers from an audio recording of the dial tones.","archived":false,"fork":false,"pushed_at":"2024-05-17T20:18:10.000Z","size":2453,"stargazers_count":297,"open_issues_count":7,"forks_count":48,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-29T07:37:02.709Z","etag":null,"topics":["dial-tones","dtmf","dtmf-decoder","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ribt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-10T18:35:52.000Z","updated_at":"2024-11-28T15:30:46.000Z","dependencies_parsed_at":"2024-11-29T10:18:12.884Z","dependency_job_id":null,"html_url":"https://github.com/ribt/dtmf-decoder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ribt/dtmf-decoder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribt%2Fdtmf-decoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribt%2Fdtmf-decoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribt%2Fdtmf-decoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribt%2Fdtmf-decoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ribt","download_url":"https://codeload.github.com/ribt/dtmf-decoder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribt%2Fdtmf-decoder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266465094,"owners_count":23933065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dial-tones","dtmf","dtmf-decoder","python","python3"],"created_at":"2024-08-09T13:01:24.286Z","updated_at":"2025-07-22T09:31:35.664Z","avatar_url":"https://github.com/ribt.png","language":"Python","funding_links":[],"categories":["Python","Links"],"sub_categories":["DTMF"],"readme":"# DTMF decoder\n(Sorry for my English, I'm not dumb but French. Feel free to make a PR to correct this README.)\n\nHave you always dreamt of finding the phone number dialled by someone in a video? It's possible now! All you have to do is record the audio of the *beeps* and this script will extract the phone number for you from the dial tones.\n\n## Installation\n(If you are on Mac or Windows, go to hell.)\n\n```\n$ git clone https://github.com/ribt/dtmf-decoder.git\n$ cd dtmf-decoder/\n$ sudo python3 -m pip install -r requirements.txt --upgrade\n$ chmod +x dtmf.py\n$ sudo cp dtmf.py /usr/local/bin/dtmf\n```\n\n## Usage\n\nYou have to give a wav file (you can try to convert it with `ffmpeg -i audio.mp3 audio.wav` for example).\n\n```\nUsage: dtmf [-h] [-v] [-l] [-r] [-d] [-t F] [-i T] file.wav\n\noptional arguments:\n  -h, --help     show this help message and exit\n  -v, --verbose  show a complete timeline\n  -l, --left     left channel only (if the sound is stereo)\n  -r, --right    right channel only (if the sound is stereo)\n  -d, --debug    show graphs to debug\n  -t F           acceptable frequency error (in hertz, 20 by default)\n  -i T           process by T seconds intervals (0.05 by default)\n```\n\n## Examples\n\nYou can test this script with these examples :\n- [a perfect file without noise](https://github.com/ribt/dtmf-decoder/blob/master/perfect-example.wav?raw=true)\n- [a non-perfect file with noise](https://github.com/ribt/dtmf-decoder/blob/master/not-perfect-example.wav?raw=true)\n\n#### The perfect case\n\n```\n$ dtmf perfect-example.wav\n0123456789\n```\nAs you can see it works perfectly, we have a classical French phone number.\n\n#### The non-perfect case\n```\n$ dtmf not-perfect-example.wav\n012374526789\n```\nWe can guess there is a problem because we have more than ten numbers. So try the verbose output:\n```\n$ dtmf -v not-perfect-example.wav\n0:00 ...................0\n0:01 0..........1111.....\n0:02 .....222............\n0:03 33........7.......44\n0:04 .......5..........2.\n0:05 .66666............77\n0:06 777.............888.\n0:07 ..........99........\n0:08 .................\n```\nWe can guess there are false positives so try to decrease the tolerance:\n```\n$ dtmf -v -t 10 not-perfect-example.wav \n0:00 ...................0\n0:01 0..........111......\n0:02 .....222............\n0:03 3..................4\n0:04 .......5............\n0:05 ..66.6..............\n0:06 7...............88..\n0:07 ...........9........\n0:08 .................\n```\nThe number `6` must have been split into two so the number is `0123456789`.\n\n## How it works\n\nThis script is quite simple. We split the signal into frames and we analyse them one by one. We calculate a Fast Fourier Transorm to find its constituent frequencies. We find the frequencies with the bigger amplitude and we compare them with the DTMF's (dual-tone multi-frequency) frequencies.\n\nDTMF keypad frequencies from Wikipedia:\n\n![array of dial tones' frequencies from Wikipedia](./dtmf-wikipedia.png \"Dial tones' frequencies\")\n\nGraph explaining the functioning :\n\n![graphs](./graphs.png)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fribt%2Fdtmf-decoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fribt%2Fdtmf-decoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fribt%2Fdtmf-decoder/lists"}