Created
March 13, 2021 20:04
-
-
Save Mosquid/7a39503aac306c0a41d2fad29534b41a to your computer and use it in GitHub Desktop.
demorse.js
This file contains 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
const audio = document.querySelector("audio"); | |
const initDecoder = (stream) => { | |
const decoder = new Demorse({ | |
stream, | |
render: (str) => { | |
// #message is a node that will be updated on decoding | |
document.querySelector("#message").innerText = str; | |
}, | |
}); | |
}; | |
audio.addEventListener("play", (e) => initDecoder(e.target)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment