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
// ==UserScript== | |
// @name No YouTube Volume Normalization | |
// @namespace https://gist.github.com/abec2304 | |
// @match https://www.youtube.com/* | |
// @grant none | |
// @version 2.1 | |
// @author abec2304 | |
// @description Enjoy YouTube videos at their true volume | |
// @inject-into content | |
// @run-at document-start |
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
/* Courtesy of Jake Albaugh: https://twitter.com/jake_albaugh/status/1118611365508337665 */ | |
const bars = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"]; | |
const ctx = new AudioContext(); | |
const analyser = ctx.createAnalyser(); | |
analyser.fftSize = 32; | |
const uIntArray = new Uint8Array(16); | |
navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => { | |
ctx.createMediaStreamSource(stream).connect(analyser); | |
updateUrl(); |