Created
July 4, 2019 14:37
-
-
Save ftuyama/b430d64d948446ad90845cebbf23fcf7 to your computer and use it in GitHub Desktop.
Binance Volume alert
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
// Access Volume Monitor: https://agile-cliffs-23967.herokuapp.com/binance | |
// Copy and past on chrome console: | |
var audio = new Audio("/static/beep.wav"); | |
var audioCtx = new AudioContext(); | |
var source = audioCtx.createMediaElementSource(audio); | |
// create a gain node | |
var gainNode = audioCtx.createGain(); | |
gainNode.gain.value = 10; // double the volume | |
source.connect(gainNode); | |
// connect the gain node to an output destination | |
gainNode.connect(audioCtx.destination); | |
var dangerCount = $('.is-danger').length; | |
setInterval(function () { | |
var newCount = $('.is-danger').length; | |
if (newCount > dangerCount) { | |
audio.play(); | |
dangerCount = newCount; | |
} | |
}, 1000); | |
// https://stackoverflow.com/questions/17762763/play-wav-sound-file-encoded-in-base64-with-javascript | |
// https://vocaroo.com/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment