Asterisk Voice Changer

June 7, 2009

Author: J.R. Tunney — Originally Posted 26 Days Ago Article Tags « asterisk c »
[Photo of a deranged cat]

This program is a voice changer module for Asterisk. This allows you to change the pitch of your voice in real time when placing VoIP calls. This software is not intended to change the gender of your voice as no formant adjustments are not implemented. This software however does an excellent job making you sound really creepy and often-times unrecognizable. Furthermore this software is not intended to guarentee your privacy as pitch shifting is not a one-way algorithm and hence can be reversed. If you are not familiar with Asterisk or Linux then you might want to check out this page instead

exten => 666,1,Set(CALLERID(all)=${BULLY_FROM_HIGHSCHOOL})
exten => 666,2,VoiceChanger(-5.0)
exten => 666,3,Dial(SIP/Level3/${THE_PRESIDENT}|30|g)
exten => 666,4,StopVoiceChanger() ; not required
; ToDo: Say bad things

Download

[zip] voicechanger-0.7.tar.gz (13KB, Released 2009-06-08)
[zip] voicechanger-0.6.tar.gz (16KB, Released 2007-07-05)
[zip] voicechanger-0.5.tar.gz (30KB, Released 2006-10-07)
[zip] voicechanger-0.4.1.tar.gz (30KB, Released 2006-10-07)
[zip] voicechanger-0.4.tar.gz (28KB, Released 2006-08-23)
[txt] ChangeLog (3KB)

Updates

  • 2009-06-08: voicechanger 0.7 released as rewrite to support audiohooks API. Not yet tested with Asterisk 1.6. Certain features such as DTMF deltas removed until I have time to re-implement them.
  • 2009-03-07: Added helpful troubleshooting information under Installation.
  • 2008-06-12: Forked soundtouch because it symlinks files in /usr/share that are only present on systems with autoconf and libtool installed. This should now install for everyone without trouble.
  • 2008-03-08: Damn soundtouch people changing filenames and can't give a playa a 301 redirect ugh
  • 2007-07-05: The new 0.6 release is Asterisk 1.4 compatible! It's about time! You also must upgrade to the latest version (0.4 or higher) of libsoundtouch4c for this new release. The latest libsoundtouch4c release hopefully fixes a bug where some people get screaching static. The voice changer is also more customizable!
  • 2006-10-07: New release 0.5. Read the ChangeLog! Lots of important stuff!
  • 2006-10-07: Bug fix release 0.4.1, see ChangeLog. I will have a version that is compatible with Asterisk 1.4 once a stable release is made.
  • 2006-08-26: Snakes on a Plane was entertaining and... gross. New version of libsoundtouch4c!
  • 2006-08-25: I no longer recommend SoundTouch 1.3.1 because it does not compile out of the box for me as well as a few other people. You can find instructions below for installing 1.3.0. People are also having some problems with libsoundtouch4c's build system. I will rewrite this tonight after I go rot my brain watching Snakes on a Plane!
  • 2005-11-24: The patch has been modified to fix the caller id issues some people were having. Great progress has been made on 0.3, expect a release in about a week if not less. I've also added CVS access for those of you who do not want to wait for releases.
  • 2005-11-18: Two users seem to be having issues using the voice changer with a PRI channel. Next week, once I get the hardware necessary, I will attempt to reproduce and fix this problem.
  • 2005-11-17: Claude Patry has been putting forward his time and expertise to help me with the voice changer software. Thanks! In the next few releases you can expect some of the following features: installing the voice changer to the peer channel, adjusting pitch with # and *, playing programmable sound files with DTMF digits, static, distortion, etc.
  • 2005-11-14: Version 0.2 Released! Although certain parts of the code are still a bit flakey (See Bugs), this revision is far more stable and usable. (Look ma! No core hacking!) The links in the download section have been updated.
  • 2005-11-11: I've just managed to encapsulate all of the voice changer in to a single application so that no dirty core hacking will be needed. We also will not have to worry about voice packets going directly between hosts and the codecs being used by the channel. I will upload this version as soon as I test it out in a production environment (Me prank phone-calling a friend, hehe).
  • 2005-11-09: Matt Riddell has just plugged this page on his Asterisk Daily News site. Be sure to check it out and thanks Matt!
  • 2005-11-09: Anthony Minessale II has been so kind as to send me a barebones Dial replacement called 'CallForward' off of which to base the Voice Changer so that no core hacking will be needed. Thanks!

Installation

On your functioning Linux machine running Asterisk with the header files installed to /usr/include/asterisk (on Ubuntu, if you installed asterisk through your package manager, also install asterisk-dev) run the following commands to install the voice changer as well as its two dependencies:

# install SoundTouch 1.3.1-jart
# you can also install it through your package manager
cd /usr/src
wget http://www.lobstertech.com/code/libsoundtouch4c/releases/soundtouch-1.3.1-jart.tar.gz
tar xvzf soundtouch-1.3.1-jart.tar.gz
cd soundtouch-1.3.1-jart/
./configure --enable-integer-samples --prefix=/usr
make
make install

# install libsoundtouch4c
cd /usr/src
wget http://www.lobstertech.com/code/libsoundtouch4c/releases/libsoundtouch4c-0.4.tar.gz
tar -xzvf libsoundtouch4c-0.4.tar.gz
cd libsoundtouch4c-0.4
./configure --prefix=/usr
make
make install

# install the voice changer
cd /usr/src
wget http://www.lobstertech.com/code/voicechanger/releases/voicechanger-0.7.tar.gz
tar -xzvf voicechanger-0.7.tar.gz
cd voicechanger-0.7
make
make install

# load it in to asterisk
make start

Pre-0.7 Documentation

exten => 666,1,Set(CALLERID(all)=${BULLY_FROM_HIGHSCHOOL})
exten => 666,2,VoiceChangeDial(SIP/Level3/${BARACK_OBAMA}|T(30)P(-5.0)D(8:9)H(*))
; ToDo: Say bad things

The application, VoiceChangeDial, functions as a Dial() replacement. Although the behavior of this application seeks to mimic Dial(), it is not perfect due to the fact that Asterisk does not properly abstract dial and bridging functionality.

Warning: If you have audio problems after following the instructions above, your two call legs may be using different codecs or the RTP stream is being bridged directly between endpoints. I highly recommend using the following sip.conf parameters for all user agents using the voice changer:

canreinvite=no
disallow=all
allow=ulaw

Docs

  -= Info about application 'VoiceChangeDial' =- 

[Synopsis]
Voice Changer Dial Application

[Description]

Usage VoiceChangeDial(dialstring[|options])

Usage:
  This app fuctions pretty much the same way as Dial() only you can do
  cool stuff like change the pitch of your voice.  Please note that
  pitch changes are not very sophisticated, this will not make a man
  sound like a woman or vice versa.  It will however do a great job of
  masking your voice by making you sound either like a chimpmunk or
  Jabba the Hut.

  Because this application needs to mangle voice data, it will need to
  pass through Asterisk back-to-back.  This means that if you are
  switching SIP, the RTP will not pass from phone to phone, but will
  be proxied through Asterisk.  Therefore, VoiceChangeDial() will use
  considerably more CPU and bandwidth than a normal Dial() operation.

Options:
  p    -- Apply effect to peer channel instead
  P(f) -- Voice pitch in semitones.  Negative is lower, positive
          is higher.  Default is -5.0
  T(n) -- Dial timeout in seconds.  If not set, waits 60 sec.
          for other side to pickup
  D(down:up[:delta]) -- Allow pitch changes during conversation by
          pressing DTMF keys 'up' and 'down' with a semitones change
          of 'delta'.  Examples:  D(*:#:5.0), D(1:2).  The default
          delta is 5.0 semitones.
  H(x) -- Allow caller to hangup the peer by pressing '*'.  This
          is different from the behavior of 'h' in previous
          releases of the voice changer.  This option trumps 'd'
  S(x) -- Allow peer to hangup themself by pressing DTMF digit 'x'.
          Mnemonic is 'suicide'.
  d    -- **DEPRECATED** Allow pitch changes during conversation with
          '*' and '#'
  h    -- **DEPRECATED** Allow caller to hangup the peer by pressing
          '*'.  This is different from the behavior of 'h' in previous
          releases of the voice changer.  This option trumps 'd'
  s    -- **DEPRECATED** Allow peer to hangup themself by pressing
          '*'.  Mnemonic is 'suicide'.  This option trumps 'd'

Recommended Invocation:

  VoiceChangeDial(SIP/bandwidth/+12036660420|T(30)P(-5.0)D(8:9)H(*))

    This will wait 30 seconds for the called party to pickup, make
    voice sound lower, and allow you to change your voice down and up
    with digits '8' and '9'.  You may also hang up the call with '*'.


Legal

Asterisk Voice Changer
Copyright (c) 2005-2007 Lobstertech, Inc.
Keep it Open Source Pigs

The program found on this page is free software and may be used, distributed, and modified under the terms of the GNU General Public License version 2.0.

This software is distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Comments

  1. Jean-Luc Picard on August 27, 2008 [Permalink]

    Excellent Work!

  2. m31uk3 on October 7, 2008 [Permalink]

    So cool I should be sleeping but I am talking to my self :)

  3. Sébastien on November 24, 2008 [Permalink]

    Hi,
    I've made an application echoVoiceChnager based on your source code.
    It's working
    Now I'm trying to add this function on your voicechangeDial
    Th only result I have is bad noise on my channel.
    Do you think it's possible?

    thanks for your response

  4. Mike on February 9, 2009 [Permalink]

    Keep getting a compile error
    please advice.
    Thank you.

    [root@localhost voicechanger-0.6]# make
    ./sanity.sh
    gcc -O -g -D_GNU_SOURCE -shared -fpic -c -o app_voicechangedial.o app_voicechangedial.c
    app_voicechangedial.c:28:27: error: asterisk/file.h: No such file or directory
    app_voicechangedial.c:29:29: error: asterisk/logger.h: No such file or directory
    app_voicechangedial.c:30:28: error: asterisk/frame.h: No such file or directory
    app_voicechangedial.c:31:30: error: asterisk/channel.h: No such file or directory

  5. jart on February 13, 2009 [Permalink]

    If you installed Asterisk through a package manager, be sure to also install the associated devel package so you can get the headers and all that good stuff.

  6. Tom [website] on February 18, 2009 [Permalink]

    For those of you out there that don't want to bother installing this great module have a look at http://pranklyspeaking.com/
    Lets you place 3 min calls using high or low pitch

  7. Polly the parrot on March 21, 2009 [Permalink]

    Any chance to get this and the Phoneparrot updated to asterisk 1.6...?

  8. Erichs [website] on March 26, 2009 [Permalink]

    Compile fails on 64 bit systems.

    mmx_optimized.cpp: In member function 'virtual void soundtouch::FIRFilterMMX::setCoefficients(const short int*, uint, uint)':
    mmx_optimized.cpp:230: error: cast from 'short int*' to 'uint' loses precision
    make[2]: *** [mmx_optimized.lo] Error 1
    make[2]: Leaving directory `/usr/src/soundtouch-1.3.1-jart/source/SoundTouch'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/usr/src/soundtouch-1.3.1-jart/source'
    make: *** [all-recursive] Error 1

  9. Chad [website] on April 7, 2009 [Permalink]

    Why doesn't voice changer record the changed voice pitch. When I play back the recording my voice is normal.

  10. Speppa on April 21, 2009 [Permalink]

    I've the same problem of Mike.
    I've installed all from source and when I try to install the voicechanger it give me this error http://paste.ubuntu.com/155458/

    How can I uninstall it? I would like try to reinstall it again

    thanks

  11. David on May 2, 2009 [Permalink]

    When I tried to install it, here's what it saying:

    [trixbox1.localdomain src]# cd soundtouch-1.3.1-jart/
    [trixbox1.localdomain soundtouch-1.3.1-jart]# ./configure --enable-integer-samples --prefix=/usr
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking for g++... no
    checking for c++... no
    checking for gpp... no
    checking for aCC... no
    checking for CC... no
    checking for cxx... no
    checking for cc++... no
    checking for cl... no
    checking for FCC... no
    checking for KCC... no
    checking for RCC... no
    checking for xlC_r... no
    checking for xlC... no
    checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
    See `config.log' for more details.
    [trixbox1.localdomain soundtouch-1.3.1-jart]#

    any idea??

  12. jay on May 23, 2009 [Permalink]

    anyone know how i can record the call with the voice changer? when calls are recorded it does not record with voice changer.....any idea?

  13. George on June 4, 2009 [Permalink]

    "Tap tap tap, is this thing on...?"

    any chances to get this ported to the new audiohooks-api (which was done exactly for this purpose, they even backlink here ;-))

    http://www.russellbryant.net/blog/200...

  14. jart [website] on June 8, 2009 [Permalink]

    @George: 0.7 has audiohooks support. Enjoy

Post Comment