8

I would like to modify the pitch of my audio output.

I know you can use software such as PlayItSlowly to listen to an audio file and alter the pitch in the process, but what I am looking for is a way to modify the pitch just as I do with the volume.

I can do it on Windows with Realtek's sound manager, so I guess there must be a way to do it on Linux as well.

edwinksl
  • 23,789

4 Answers4

0

Install ALSA equalizer plugin:

sudo apt-get install libasound2-plugin-equal

Prepare your .asoundrs file, so that ALSA will know about the plugin:

gedit .asoundrc

Paste inside it (or append at the end, if it already contains some data):

ctl.equal {
   type equal;
}

pcm.plugequal {
    type equal;
   slave.pcm "plughw:0,0";
}

pcm.equal{
    type plug;
    slave.pcm plugequal;
}

Save the file and exit.

Next, reload ALSA:

sudo alsa force-reload

Your equalizer should be set-up. To use it, run

alsamixer -D equal

TADA! Your alsamixer will now behave as an equalizer, instead of adjusting volumes. Hope this helps!

0

There are several options. Many of them require Soundtouch, which is a plugin from the Gstreamer set "bad". Run

sudo apt install gstreamer1.0-plugins-bad

I wouldn't know which of the options listed below do not satisfy your requirement "just as I do with the volume", and why (e.g., playitslowly).

Sound stretch

Soundstretch seems to do the trick.

SoundStretch is a simple command-line application that can change tempo, pitch and playback rates of WAV sound files. This program is intended primarily to demonstrate howthe "SoundTouch" library can be used to process sound in your own program, but it can as well be used for processing sound files.

Usage:

soundstretch infile.wav outfile.wav [options]

Options:

...
-pitch=n Change the sound pitch by n semitones (n = -60.0 .. + 60.0 semitones)
...

Play it slowly

playitslowly (official documentation) is a GUI, which also provides for a change in pitch. See also here.

enter image description here

ffmpeg

Apparently, ffmpeg can also be used to change pitch.

Audacity

Same as with ffmpeg.

PitchBox

See official info.

Others

There may be other options associated with different pieces of LADSPA software.

Related:

  1. How can I apply a LADSPA plugin to a PulseAudio stream?
  • How does this change the pitch of sound output? – svin83 Oct 13 '21 at 16:05
  • @svin83 - I don't understand your question. The methods provided do exactly that. If you are asking about the details of the implementation at the programming level, or even at the hardware level, I don't know, and I don't think the OP is interested either. But if you mean that you don't see this answers the question, I suggest you simply try what is posted. I did it, and it works perfectly. – sancho.s ReinstateMonicaCellio Oct 18 '21 at 06:36
  • I know that the output stream is a file you can pipe output to, but most users don't know that just about every device API in Linux is a file. – svin83 Nov 01 '21 at 12:45
0

There are two programs that I know of that can do this. One is called rubberband. You can also see the manual page here. It is a time and pitch shifter. These two tools go hand in hand, as shifting the pitch will let you speed up the tempo without turning the result into a chipmunks track.

You can get rubberband from apt. It also has a command-line interface available with rubberband-cli.

The other is zita-retune. It is available on apt as well. It exposes the command zretune, which does the same as above through resampling. The zita library is very popular among Linux audio community, and has just about any type of pro-audio software tool there is.

I got both of them in the Ubuntu Studio Tools Installer kit. It is an apt package (namely ubuntustudio-installer) that gives you all of the sound design tools that come with studio, including the lowlatency kernel, but installs them in a way where they seem more like an added feature to the standard ubuntu flavor and not so much like a different flavor altogether. I personally just load the lowlatency kernel, when I need it, and stick with generic the rest of the time, as the lowlatency doesn't handle multiple monitors very well.

Nate T
  • 1,524
-3

Use the alsa-mixer

Open a terminal and type sudo apt-get install gnome-alsamixer alsamixergui libasound2-plugin-equal alsa-utils

enter image description here

Ringtail
  • 16,127
  • 10
    I have tried really hard to understand what you meant, but I don't see where alsa-mixer does something else than adjusting volumes ... – user1092407 Apr 15 '12 at 08:55