I'm looking for a software that reproduces audio files (wav and mp3 if possible) and provides a way to change the playback speed in real-time, flawlessy. I mean, without any gap, pop, or noise. Like the sampling clock is changed smoothly.

I'm NOT interested in maintaining the pitch constant (like this question: Play a sound file slower or faster). Instead the pitch MUST follow the new speed.

I need to change the speed programmatically, say from 20% to 200% of the original one.

Is there something ready, without reinventing the wheel?


5 Answers 5


mplayer can playback wav and mp3 files, and you can interactively change the speed with keys [ and ], although wav files cannot be played slower than than their original speed. vlc can do the same and manages to slow down wav files too. Faster speeds move the frequencies up.

  • 1
    Same for mpv, a fork of mplayer. And both can play wav files at slower speeds on my machine.
    – xhienne
    Commented Aug 23, 2017 at 9:30
  • @xhienne You are right. mplayer did slow down some wav files, but I had one sampled at 8000Hz which it failed to slow down, whereas mpv managed ok. Perhaps I just have an old version.
    – meuh
    Commented Aug 23, 2017 at 9:50

You can use mplayer -af scaletempo -speed 0.5 filename.mp3 to change the playspeed without changing the audio pitch.

If you would like to change the speed in real time (after calling mplayer from the command line), you will have to create run player in slave mode.


  1. https://stackoverflow.com/questions/36867732/slave-mode-mplayer-pipe
  2. https://stackoverflow.com/questions/15856922/python-send-command-to-mplayer-under-slave-mode


class SimpleMplayerPlayer(SimpleProcessPlayer, SoundOrVideoPlayer):
    args, env = _packagedCmd(["mplayer", "-really-quiet", "-noautosub"])
    if isWin:
        args += ["-ao", "win32"]

class SimpleMplayerSlaveModePlayer(SimpleMplayerPlayer):
    def __init__(self, taskman: TaskManager):

    def _play(self, tag: AVTag) -> None:
        assert isinstance(tag, SoundOrVideoTag)
        self._process = subprocess.Popen(
            self.args + [tag.filename],

    def command(self, *args: Any) -> None:
        """Send a command over the slave interface.
        The trailing newline is automatically added."""
        str_args = [str(x) for x in args]
        if self._process:
            self._process.stdin.write(" ".join(str_args).encode("utf8") + b"\n")

    def seek_relative(self, secs: int) -> None:
        self.command("seek", secs, 0)

    def toggle_pause(self) -> None:
  • The scaletempo allows change in speed but does not change the pitch. The OP specifically states, "the pitch MUST follow the new speed". Omit the scaletempo option entirely to allow pitch to follow speed. Commented May 5, 2020 at 11:04

For those who need to set up speed from command line, use -speed SPEED option:

mplayer -speed 0.1 file

NOTE: you can change this speed in real time with [ and ] keys.

Of course, works for mpv as well.

Credits: https://linuxacademy.com/blog/linux/tutorial-playing-around-with-mplayer/

  • 2
    As far as I understand, this doesn't address the question because you cannot change the speed parameter in real time as requested.
    – Mark
    Commented Jun 4, 2018 at 7:53
  • @Mark you're right. Should I delete the question?
    – pevik
    Commented Jun 4, 2018 at 7:56
  • Or just edit the answer adding that it doesn't work in real time. Perhaps others might find it useful anyway.
    – Mark
    Commented Jun 4, 2018 at 7:57
  • 1
    @Mark OK like this?
    – pevik
    Commented Jun 4, 2018 at 9:12

For readers in 2022 with mplayer (in my case installed via brew), put this in your terminal config (in my case .zshrc):

alias mplayer="mplayer -af scaletempo=speed=tempo"

then during playing you can tune the playback speed via ](increase) and [(decrease). Don't forget that /(decrease volume), and *.


As user said

mplayer -af scaletempo file.mp4

Is what you need. Scale tempo (speed) while maintaining pitch. Basically the speed changes but you don't get the chipmunk/ghost effect when the speed is much higher/lower.

More info on scaletempo here

Now, using "[" or "]" you can increase/decrease the playback speed on the fly.

As that cannot be preset on settings (or I couldn't find how), I decided to create a desktop entry (kind of alias for an app in LXDE desktop) so I can open the relevant files from file explorer with that coded loaded in.

I leave it here in case someone wants it.

[Desktop Entry]
Name=mplayer scaletempo
GenericName=Media Player
X-GNOME-FullName=MPlayer Media Player
Comment=Play movies and songs
Exec=/usr/bin/mplayer -af scaletempo %F

If you put that on a text file as blah.desktop you have your "new" application ready to be used from the window manager.

  • 1
    The scaletempo allows change in speed but does not change the pitch. The OP specifically states, "the pitch MUST follow the new speed". Omit the scaletempo option entirely to allow pitch to follow speed. Commented May 5, 2020 at 11:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .