Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Read DTMF key tones from an MP3/wav file in .NET

NotificationsYou must be signed in to change notification settings

adamstirtan/dtmf-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

tl;dr

The process of translating a button pushed on a telephone to its value.

Running the app

dotnet run

Output

Detected 30 DTMF changes- in 181 msButtons: 1 2 3 4 5 6 7 7 8 9 * * 0 # 1

Show me the code!

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}");

About

Read DTMF key tones from an MP3/wav file in .NET

Topics

Resources

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp