These days there are a lot of ways to make a computer talk and having one universal way for MyRobotLab do it would be nice but if you're looking for a hack way of doing it here's an option that doesn't require an active Internet connection but will require some other speech software to be installed on your computer.

I'm using Mac OS X much to Grog's dismay so here's how I'm doing it with 2 lines of Python in MRL.

 

import subprocess
subprocess.call(["/usr/bin/say", "One software to rule them all"])

OS X comes with a command line program called "say" which will speak whatever is passed to it. It has a bunch of customization options.

$man say

NAME
       say - Convert text to audible speech

SYNOPSIS
           say [-v voice] [-r rate] [-o outfile [audio format options] | -n name:port | -a device] [-f file | string ...]

DESCRIPTION
       This tool uses the Speech Synthesis manager to convert input text to audible speech and either play it through the sound output device chosen in System Preferences or save it to an AIFF file.

OPTIONS
       string
           Specify the text to speak on the command line. This can consist of multiple arguments, which are considered to be separated by spaces.

       -f file, --input-file=file
           Specify a file to be spoken. If file is - or neither this parameter nor a message is specified, read from standard input.

       --progress
           Display a progress meter during synthesis.

       -v voice, --voice=voice
           Specify the voice to be used. Default is the voice selected in System Preferences. To obtain a list of voices installed in the system, specify '?' as the voice name.

       -r rate, --rate=rate
           Speech rate to be used, in words per minute.

       -o out.aiff, --output-file=file
           Specify the path for an audio file to be written. AIFF is the default and should be supported for most voices, but some voices support many more file formats.

       -n name, --network-send=name
       -n name:port, --network-send=name:port
       -n :port, --network-send=:port
       -n :, --network-send=:
           Specify a service name (default "AUNetSend") and/or IP port to be used for redirecting the speech output through AUNetSend.

       -a ID, --audio-device=ID
       -a name, --audio-device=name
           Specify, by ID or name prefix, an audio device to be used to play the audio. To obtain a list of audio output devices, specify '?' as the device name.

       If the input is a TTY, text is spoken line by line, and the output file, if specified, will only contain audio for the last line of the input.  Otherwise, text is spoken all at once.

 

$ say -v ?
Agnes               en_US    # Isn't it nice to have a computer that will talk to you?
Albert              en_US    #  I have a frog in my throat. No, I mean a real frog!
Alex                en_US    # Most people recognize me by my voice.
Bad News            en_US    # The light you see at the end of the tunnel is the headlamp of a fast approaching train.
Bahh                en_US    # Do not pull the wool over my eyes.
Bells               en_US    # Time flies when you are having fun.
Boing               en_US    # Spring has sprung, fall has fell, winter's here and it's colder than usual.
Bruce               en_US    # I sure like being inside this fancy computer
Bubbles             en_US    # Pull the plug! I'm drowning!
Cellos              en_US    # Doo da doo da dum dee dee doodly doo dum dum dum doo da doo da doo da doo da doo da doo da doo
Deranged            en_US    # I need to go on a really long vacation.
Fred                en_US    # I sure like being inside this fancy computer
Good News           en_US    # Congratulations you just won the sweepstakes and you don't have to pay income tax again.
Hysterical          en_US    # Please stop tickling me!
Junior              en_US    # My favorite food is pizza.
Kathy               en_US    # Isn't it nice to have a computer that will talk to you?
Pipe Organ          en_US    # We must rejoice in this morbid voice.
Princess            en_US    # When I grow up I'm going to be a scientist.
Ralph               en_US    # The sum of the squares of the legs of a right triangle is equal to the square of the hypotenuse.
Trinoids            en_US    # We cannot communicate with these carbon units.
Vicki               en_US    # Isn't it nice to have a computer that will talk to you?
Victoria            en_US    # Isn't it nice to have a computer that will talk to you?
Whisper             en_US    # Pssssst, hey you, Yeah you, Who do ya think I'm talking to, the mouse?
Zarvox              en_US    # That looks like a peaceful planet.

 

On Linux I used to use "festival" to do text-to-speech but I haven't used that in years.  I'm sure MS has something that could be used too.

GroG

10 years 8 months ago

You've gotten me thinking KMC .. 

As InMoov and its scripts mature they morph into more complex systems.  One way of reducing complexity is standardizing.  I was wondering if it would be worth enhancing the Speech service to include access to these command like speakers.  In that the scripts would not need to change and mouth.speak & mouth.speakBlocking could be used excercise the command line programs.

It would  have the additional benefit of causing events which are sent to the "ear" so not to try to speech recognize its own voice.

wkinne

10 years 8 months ago

speech recognition is where we need improvement, my InMoov will already say anything I enter into the script. And say it with great accuracy. I wish I could say the same for the recognition side.