Skip to content

Instantly share code, notes, and snippets.

@dshemetov
Created January 29, 2026 02:00
Show Gist options
  • Select an option

  • Save dshemetov/3fe10758f0167be61b9be2561906c7ac to your computer and use it in GitHub Desktop.

Select an option

Save dshemetov/3fe10758f0167be61b9be2561906c7ac to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Bandcamp Speed Control
// @match https://*.bandcamp.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function setPlaybackRate(rate) {
const audio = document.querySelector('audio');
if (audio) {
audio.playbackRate = rate;
audio.preservesPitch = true; // optional: disable pitch correction
}
}
const container = document.createElement('div');
container.style.cssText = 'top:10px; right:10px; z-index:9999; display:flex; gap:8px; align-items:center; padding:8px; border-radius:4px;';
// Create a simple slider
const slider = document.createElement('input');
slider.type = 'range';
slider.min = 0.5;
slider.max = 1.5;
slider.step = 0.05;
slider.value = 1.0;
// Create display
const display = document.createElement('span');
display.style.cssText = 'font-family:monospace; min-width:40px; text-align:right;';
display.textContent = '1.00x';
slider.addEventListener('input', (e) => {
const rate = parseFloat(e.target.value);
setPlaybackRate(rate);
display.textContent = rate.toFixed(2) + 'x';
});
container.appendChild(slider);
container.appendChild(display);
document.querySelector(".inline_player").appendChild(container);
// Apply rate when audio loads
const observer = new MutationObserver(() => {
setPlaybackRate(parseFloat(slider.value));
});
observer.observe(document.body, { childList: true, subtree: true });
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment