Created
September 10, 2018 02:02
-
-
Save AugustKarlstedt/4f34d1c3f4705f660d4bbf03f2660e5f to your computer and use it in GitHub Desktop.
YouTube Speech Audio Filter (TamperMonkey UserScript)
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 YouTube Speech Audio Filter | |
// @namespace NONE | |
// @version 1.0 | |
// @description I wrote this because of background noise in Rachel Thomas's Computational Linear Algebra series, but it probably could be used elsewhere. | |
// @author August Karlstedt | |
// @match https://www.youtube.com/watch?v=* | |
// @grant none | |
// @run-at document-end | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); | |
var source = audioCtx.createMediaElementSource(document.querySelector('.video-stream')); | |
var highpassFilter = audioCtx.createBiquadFilter(); | |
highpassFilter.type = "highpass"; | |
highpassFilter.frequency.value = 440; | |
var lowpassFilter = audioCtx.createBiquadFilter(); | |
lowpassFilter.type = "lowpass"; | |
lowpassFilter.frequency.value = 4400; | |
source.connect(highpassFilter); | |
highpassFilter.connect(lowpassFilter); | |
lowpassFilter.connect(audioCtx.destination); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment