-
-
Save chriscorwin/890b6ac4cf0cd26b406406ff866f666d to your computer and use it in GitHub Desktop.
MHALL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Navigate to http://onlinetonegenerator.com/dtmf.html | |
// Open DevTools - Console | |
// Paste the Code | |
// Press Enter | |
// Provide the number of milliseconds the default tone should hold for | |
let short = 250; | |
let long = short * 2; | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
let release = async function(duration){ | |
await sleep(duration); | |
stop(); | |
} | |
let three = async function(duration = short) { | |
dialTone(697.0, 1477.0); | |
await release(duration); | |
} | |
let two = async function(duration = short) { | |
dialTone(697.0, 1336.0); | |
await release(duration); | |
} | |
let one = async function(duration = short) { | |
dialTone(697.0, 1209.0); | |
await release(duration); | |
} | |
let nine = async function(duration = short) { | |
dialTone(852.0, 1477.0); | |
await release(duration); | |
} | |
async function play() { | |
await three(); | |
await two(); | |
await one(); | |
await two(); | |
await three(); | |
await three(); | |
await three(long); | |
await two(); | |
await two(); | |
await two(long); | |
await nine(); | |
await nine(); | |
await nine(long); | |
await three(); | |
await two(); | |
await one(); | |
await two(); | |
await three(); | |
await three(); | |
await three(); | |
await three(); | |
await two(); | |
await two(); | |
await three(); | |
await two(); | |
await one(); | |
} | |
play(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment