⏩ Fast-forwards long pauses between sentences — watch lectures ~1.5x faster (browser extension)
Download:
or from GitHub: Chromium / Gecko (Firefox)
Skips silent parts in videos, in real time.
Can be useful for watching lectures, stream recordings (VODs), webinars, podcasts, and other unedited videos.
Demo:
Inspired by this video by carykh.
Simple (mostly).
Currently there are 2 separate algorithms in place.
The first one we call "the stretching algorithm", and it's in this file. It simply looks at the output audio of a media element, determines its current loudness and, when it's not loud, increases its playbackRate
. (We're using Web Audio API's
createMediaElementSource
and AudioWorkletProcessor
for this).
But looking ahead (a.k.a. "Margin before") is important, because, for example, there are certain sounds in speech that you can start a word with that are not very loud. But it's not good to skip such sounds just because of that. The speech would become harder to understand. For example, "throb" would become "rob".
Here is where the "stretching" part comes in. It's about how we're able to "look ahead" and slow down shortly before a loud part. Basically it involves slightly (~200ms) delaying the audio before outputting it (and that is for a purpose!).
Imagine that we're currently playing a silent part, so the playback rate is higher. Now, when we encounter a loud part, we go "aha! That might be a word, and it might start with 'th'".
As said above, we always delay (buffer) the audio for ~200ms before outputting it. So we know that these 200ms of buffered audio must contain that "th" sound, and we want the user to hear that "th" sound. But remember: at the time we recorded the said sound, the video was playing at a high speed, but we want to play back that 'th' at normal speed. So we can't just output it as is. What do we do?
What we do is we take that buffered (delayed) audio, and we slow it down (stretch and pitch-shift it) so that it appears to have been played at normal speed! Only then do we pass it to the system (which then passes it to your speakers).
And that, kids, is why we call it "the stretching algorithm".
For more details, you can check out the comments in its source code.
The second algorithm is "the cloning algorithm", and it's here. It creates a hidden clone of the target media element and plays it ahead of the original element, looking for silent parts and writing down where they are. When the target element reaches a silent part,
we increase its playbackRate
, or skip (seek) the silent part entirely.
Currently you can enable this algorithm by checking the "Use the experimental algorithm" checkbox.
We look for video elements by
injecting a script in all pages
and simply
document.getElementsByTagName('video')
.
But new video elements could get inserted
after the page has already loaded,
so we watch for new elements with a MutationObserver
.
Install base tools:
Run
yarn install
Fill the src/_locales
directory with localization files. Skip this step if they're already there. Either:
If you're using git
:
git submodule update --init
If you don't want to use git
, download them from the translations
branch and put in src/_locales
manually.
To build for Gecko (e.g. Firefox):
yarn build:gecko
To build for Chromium (e.g. Chrome, Edge)
yarn build:chromium
Bundled files will appear in ./dist-gecko
(or ./dist-chromium
).
For development build, see CONTRIBUTING.md
Then you can install it on the extensions management page of your browser (Chromium, Gecko).
In short: it's fine.
As with practically every other extension, websites you're visiting may detect that you're using this (or alike) extension, and your settings for the extension, by observing:
createMediaElementSource
has been called for an element.However I doubt that currently there are services that do specifically this. But there may be.
Other than that, there are no known things concerning this. It doesn't interact with third parties or try to do other creepy stuff.
Monero (XMR):
Bitcoin (BTC):
bitcoin:bc1qdfz74882mlk64pj4ctpdegvxv9r7jgq8xs2qkxpv3gkv5xqygvgs0fyzm9