Dual-tone multi-frequency signaling (DTMF) is a telecommunication signaling system using the voice-frequency band over telephone lines between telephone equipment and other communications devices and switching centers.[1] DTMF was first developed in the Bell System in the United States, and became known under the trademark Touch-Tone for use in push-button telephones supplied to telephone customers, starting in 1963. DTMF is standardized as ITU-T Recommendation Q.23.[2] It is also known in the UK as MF4.
The process of translating a button pushed on a telephone to its value.
dotnet run
Detected 30 DTMF changes- in 181 msButtons: 1 2 3 4 5 6 7 7 8 9 * * 0 # 1
usingSystem.Diagnostics;usingDtmfDetection;usingDtmfDetection.NAudio;usingNAudio.Wave;usingvartones=newAudioFileReader("dtmf_tones.mp3");Stopwatchstopwatch=Stopwatch.StartNew();List<DtmfChange>dtmfChanges=tones.DtmfChanges();stopwatch.Stop();Console.WriteLine($"Detected{dtmfChanges.Count} DTMF changes");Console.WriteLine($"- in{stopwatch.ElapsedMilliseconds} ms\n");stringbuttonSequence=string.Join(" ",dtmfChanges.Where(x=>x.IsStart).Select(key=>{intvalue=(int)key.Key;returnvalueswitch{34=>"#",35=>"*", _=>value.ToString(),};}).ToArray());Console.WriteLine($"Buttons:{buttonSequence}");