Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Female Robotic Text-To-Speech Tutorial

  1. #1
    Join Date
    Jan 2008
    Beans
    185
    Distro
    Ubuntu 13.04 Raring Ringtail

    Female Robotic Text-To-Speech Tutorial

    Hi, I've been trying to get a robotic voice TTS to replace the default voice in espeak, which is boring and terrible.

    I have achieved a female robotic voice, which I explain how to obtain here.

    The tools used are
    • espeak
    • sox (play)


    First, to "say" something with espeak, the TTS engine, you can use the following code:
    Code:
    echo "All systems online" | espeak
    The voice the text is read with is the one we want to change. Specifically for the female robotic voice, we are going to use as base voice the female3 voice. We can set espeak to use it with the -v parameter, followed by the name of the voice: e.g.
    Code:
    echo "I sound like a female" | espeak -v female3
    Now is when the robotic part comes in. Robotic voices are typically characterized by two things:
    • Echo
    • Metallic sound


    These effects we can achieve with the sound manipulation application play, which is an interface to sox used solely for playing audio.
    You can read the manual on sox
    Code:
    man sox
    to understand the following code, which will transform normal computer voice into robotic-ish voice. You should read the espeak manual as well.


    OBTAINING THE ROBOTIC VOICE
    To get the robotic voice, follow these steps:
    1. Save the following text in a text file (in this example, it will be referred to as femalebot:
      Code:
      espeak --stdout -v female3 | play -t wav - \
      overdrive 10 \
      echo 0.8 0.8 5 0.7 \
      echo 0.8 0.7 6 0.7 \
      echo 0.8 0.7 10 0.7 \
      echo 0.8 0.7 12 0.7 \
      echo 0.8 0.88 12 0.7 \
      echo 0.8 0.88 30 0.7 \
      echo 0.6 0.6 60 0.7 \
      gain 8
      The metallic effect is achieved by using the echo effect with a very short delay. The overdrive enhances the sound a bit, and the other echo effects give the final kick to the robotic voice.

    2. Now, set it to be executable with the chmod command, e.g.
      Code:
      chmod +x /path/to/femalebot
    3. You can now use the robot voice in TTS, by issuing the following command:
      Code:
      echo "All systems online." | /absolute/path/to/femalebot


    Additionally, and to make things easier, you can place the script in any directory in the PATH variable. This way, you can issue the last command as follows:
    Code:
    echo "All systems online." | femalebot
    **America != USA | American != Usanian**
    Own a Dell XPS M1530? Join the group!

  2. #2
    Join Date
    May 2007
    Beans
    Hidden!

    Re: Female Robotic Text-To-Speech Tutorial

    Sweet! Very sci-fi! Works as described. I'm going to have fun with this.

  3. #3
    Join Date
    Jun 2005
    Location
    Buenavista, ADN, Phils
    Beans
    285

    Re: Female Robotic Text-To-Speech Tutorial

    Very nice.
    I have been playing around with it every now and then for a month or two trying to get the female voice to sound more life like.
    Mac Mini: OSX 10.9 Mavericks, i7-3720QM 2.6Ghz, 16GB RAM, 1.25TB Fusion Array, Intel HD4000 iGPU
    Photo Blog on Youtube: www.youtube.com/user/ExodistPhotoBlog
    Linux User: 380654

  4. #4
    Join Date
    Nov 2010
    Beans
    16

    Re: Female Robotic Text-To-Speech Tutorial

    Nice, tts is fun to play with. I'll test it this weekend.

    Btw, it's called fembot ;P

  5. #5
    Join Date
    Aug 2008
    Location
    Brazil
    Beans
    12,497
    Distro
    Ubuntu Studio 12.04 Precise Pangolin

    Re: Female Robotic Text-To-Speech Tutorial

    Cool. Now I can add voice to my scripts.

    BTW, the sox script didn't work for me.

  6. #6
    Join Date
    Aug 2008
    Location
    NYC
    Beans
    544
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Female Robotic Text-To-Speech Tutorial

    ill give this a shot. I tried this on KDE because they have this feature where it can tell you the time, but I couldnt get it to sound normal.
    Last edited by tjeremiah; July 27th, 2011 at 03:26 PM.
    Intel i5 Ivy Bridge 2.8Ghz (3.4Ghz Turbo), 64bit user, AMD GPU 7700 series

  7. #7
    Join Date
    Jan 2008
    Beans
    185
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Female Robotic Text-To-Speech Tutorial

    You can easily let it tell you the time by adding a cron job I did it myself, on an hourly basis.

    However, I did some modifications to my script, I think it sounds a bit better:

    Code:
    espeak --stdout -v female3 | play -t wav - \
    overdrive 10 \
    echo 0.8 0.8 5 0.7 \
    echo 0.8 0.7 6 0.7 \
    echo 0.8 0.7 10 0.7 \
    echo 0.8 0.7 12 0.7 \
    echo 0.8 0.88 12 0.7 \
    echo 0.8 0.88 30 0.7 \
    echo 0.6 0.6 60 0.7 \
    gain 8
    Quote Originally Posted by lovinglinux View Post
    Cool. Now I can add voice to my scripts.

    BTW, the sox script didn't work for me.
    Does it throw an error or something?
    **America != USA | American != Usanian**
    Own a Dell XPS M1530? Join the group!

  8. #8
    Join Date
    Feb 2010
    Location
    In My Food Forest
    Beans
    9,318

    Re: Female Robotic Text-To-Speech Tutorial

    Moved to Tutorials & Tips. In the future please post your tutorials here and wait for them to be approved.

    Thanks,
    uRock
    Cheers & Beers, uRock
    [SIGPIC][/SIGPIC]

  9. #9
    Join Date
    Jun 2005
    Location
    Buenavista, ADN, Phils
    Beans
    285

    Re: Female Robotic Text-To-Speech Tutorial

    Here is one I think is fairly good. Its less glass sounding then Wolis but will require some minor editing to one of the voices in the espeak shared data directory.

    Editing the F5 voice in the voices/!v folder, copy and past this data over the existing voice info in that file:

    Code:
    language variant 
    name female5 
    gender female 
    
    pitch 165 220
    roughness 0
    
    formant 0 105  80 150 
    formant 1 110  80 160 
    formant 2 110  70 150 
    formant 3 110  70 150 
    formant 4 115  80 200 
    formant 5 115  80 100 
    formant 6 110  70 150 
    formant 7 110  70 100 
    formant 8 110  70 150 
    
    stressAdd 0 0 -10 -10 0 0 10 40 
    breath 5 14  16   16   16   6  0 10 
    echo 20 10 
    voicing 75 
    consonants 150 150
    breathw 150 150 200 200 400 400
    Then use this script to get the voice fine tuned a great deal:
    Code:
    espeak --stdout -s120 -k18 -a200 -v female5 | play -t wav - \
    chorus 0.4 0.8 20 0.5 0.10 2 -t \
    echo 0.9 0.8 33 0.9 \
    echo 0.7 0.7 10 0.2 \
    echo 0.9 0.2 55 0.5 \
    gain 10
    Cheers..
    Mac Mini: OSX 10.9 Mavericks, i7-3720QM 2.6Ghz, 16GB RAM, 1.25TB Fusion Array, Intel HD4000 iGPU
    Photo Blog on Youtube: www.youtube.com/user/ExodistPhotoBlog
    Linux User: 380654

  10. #10
    Join Date
    Jan 2008
    Beans
    185
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Female Robotic Text-To-Speech Tutorial

    Nice job! The female voice is a lot more clear! Sometimes I barely understand the other one!
    **America != USA | American != Usanian**
    Own a Dell XPS M1530? Join the group!

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •