22

I need a way to modulate my voice on-the-fly (to lower or raise pitch, etc, for privacy) for use in Mumble, TeamSpeak and other such programs. Is there any way to do this under Linux/Ubuntu?

I have found a couple possible programs under Windows, and if necessary I could run Mumble, TeamSpeak, etc. under VirtualBox/Wine along with a modulator, but I would far prefer to use Linux, although I have not been able to find any native programs for Linux that can do this during my quick Google search.

3 Answers 3

30
  1. Install some necessary software:

    sudo apt-get install sox libsox-fmt-pulse pavucontrol
    
  2. Make a null-sink in pulseaudio:

    pactl load-module module-null-sink
    
  3. Start sox recording from the default recording device (default source) and outputing to the the null-sink:

    sox -t pulseaudio default -t pulseaudio null pitch -800
    

    (If you don't want to record from the default source, change the above command accordingly.) The -800 in the above command is the desired pitch change, you can modify that value as you want, e.g. -300, +200, +500, etc. . sox also have some other "effects" other than pitch changing which can be applied to the audio, you may want to check those out in man sox.

  4. Start your capturing program (Skype, Teamspeak, etc.).

  5. Start pavucontrol.

  6. While you capturing program is trying to capture it will show up in pavucontrol under the Recording tab. Change its recording source from the default to Monitor of Null Output.

    pavucontrol settings

  7. Check the results, it should be working.

Notes:

  1. You can make pulseaudio load the null-sink automatically, if you edit the /etc/pulse/default.pa file and add the following line to the end of that file:

    load-module module-null-sink
    
  2. The changes you make in pavucontrol will be remembered, so the next time you start you capturing program it will automatically try to record from the null-sink. If this is not OK for you, then just change back the source to the default in pavucontrol when you need.

  3. If you prefer the terminal way: You can set the recording source for your capture program in the terminal (without using pavucontrol), if you launch your program with the PULSE_SOURCE variable set correctly. E.g. to launch skype recording from the monitor source of the null sink:

    PULSE_SOURCE=null.monitor skype
    
  4. Changing the pitch of your voice doesn't give you very good privacy:

    • If the other end knows you, knows you real voice, then you will have to alter the pitch a lot, so it will be obvious for the other end that you altered your sound. If he wants, he can capture your altered voice and change back the pitch. Or the other end may just ignore/reject your call for obvious reasons.
    • If the other end doesn't know your real voice, well... In this case there is no real benefit from altering your voice, since they don't even know the real one.
    • If you are trying to protect against someone intercepting your voice, a man-in-the-middle attack, etc. , then it is very likely that those malicious guys know quite enough to recover your real sound from almost any modification you do on it with such simple softwares.
    • Also, for all the above cases: When you speak, it is not just the sound of your voice what can identify you, but the way you speak, your accent, the words and phrases you use, etc.
    • If you want a more secure way for voice communication, you may want to use a text-to-speech engine to turn your typing into voice. That is a much more secure way. (Of course this might not be a possibility if it is not possible to type your messages, e.g. in a multiplayer game.)

Nevertheless, this method gives better privacy then no privacy at all. And it can be also fun to fool some friends with an altered voice.

6
  • any idea on how I can apply a LADSPA plugin without using sox? maybe using the same null sink (askubuntu.com/questions/43950/…). I don't like the idea of having to enable "recording" and pipe that. Nov 20, 2014 at 16:40
  • This is awesome and exactly what I was looking for, thanks!
    – xamox
    Nov 5, 2015 at 16:03
  • this can also be used to change the default output pitch, not only input. pavucontrol is really powerful. thank you
    – phil294
    Jan 3, 2018 at 0:04
  • 2
    unfortunately, it also adds a delay which seems to dramatically increase over time
    – phil294
    Jan 3, 2018 at 0:44
  • @phil294, I found ways to reduce the latency significantly. For example, try: nice -n -8 sox --buffer 2048 -c 1 -r 48000 -t pulseaudio default -t pulseaudio null pitch -800. The combination of a lower nice value and the -c (channels), -r (samplerate) and --buffer (the default is 8192 bytes (!), see here) does wonders. Channel count and samplerate must ideally match your source. (continues...)
    – Marc.2377
    Dec 12, 2019 at 0:42
4

You might want to check this out, its a java program that runs under linux and windows that does what you want. http://www.pitchtech.ch/PitchBox/

1

I have also been looking for a similar application. I think I have found a possible answer: LV2 and its VocProc plugin

I found this through this Ubuntu Forums thread, which may also be of use to you.

There are also plugins for Teamspeak to allow you to edit your voice. There may be other plugins for mumble also I will continue looking.

2
  • @Oli This is a LOA. Remove the links and nothing is left.
    – Pilot6
    Mar 31, 2016 at 15:43
  • 1
    @Pilot6 I strongly disagree. Take the link(s) away and the answer still tells you the name of an application that does what is asked for.
    – Oli
    Mar 31, 2016 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.