Skip to content

Instantly share code, notes, and snippets.

@Mosquid
Created March 13, 2021 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mosquid/7a39503aac306c0a41d2fad29534b41a to your computer and use it in GitHub Desktop.
Save Mosquid/7a39503aac306c0a41d2fad29534b41a to your computer and use it in GitHub Desktop.
demorse.js
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