RiTa
index
Name RiSpeech
Description Provides basic cross-platform text-to-speech facilities with control over a range of parameters including voice-selection, pitch, speed, rate, etc. When needed, multiple RiSpeech objects can be created, each with their own parameters, for concurrent speech.

Note: requires the installation of one or more FreeTTS compatible voices (see the RiTa+TTS install which includes a default 16-bit voice)...

To receive callbacks when a RiSpeech object has completed speaking a chunk of text, implement the following method in your applet:

   void onRiTaEvent(RiTaEvent re) {
     RiSpeech rs = (RiSpeech)re.getSource();
     String lastSpokenText = re.getData();
     ...
   }

Also compatible with mbrola voices (http://tcts.fpms.ac.be/synthesis/mbrola.html), but requires a local installation of the mbrola binary (which must be named 'mbrola'), as well as a call to:

   RiSpeech.setMbrolaBase(String pathToMbrola);
Specific instructions for installing and testing mbrola with RiTa can be found here.

Note: there is currently an incompatability w' FreeTTS and Mbrola on Mac OSX, but you can use the native MacTTS voices with code as follows:

    RiSpeech rs = new RiSpeech(this);
    rs.useMacTTS();
    rs.setVoice("Bruce");
    rs.speak("Hello");
The default voices included on the Mac are:
    "Victoria", "Agnes", "Kathy", "Princess", "Vicki", 
    "Bruce", "Fred", "Junior", "Ralph", "Albert",
    "Bad News", "Bahh", "Bells", "Boing", "Bubbles", 
    "Cellos", "Deranged", "Good News", "Hysterical", 
    "Pipe Organ", "Trinoids", "Whisper", "Zarvox"
    
Constructors
RiSpeech(pApplet);
RiSpeech(pApplet, voiceName);
RiSpeech(pApplet, voiceName, mbrolaBase);
Methods
delete()   Cleans-up resources associated with the text-to-speech engine. Automatically called on 'shutdown' when using Processing.

dispose()   Cleans-up resources on program end - not to be called in user-code.

getAvailableVoiceNames()   Returns the names for all currently available voices.

getOutputFile()   Returns the current output filename of null if none is specified.

getVoiceDescription()   Returns descriptive info on the current voice

getVoiceDescriptions()   Returns the names and descriptions for each available voice.

getVoiceName()   Returns a descriptive name for the current voice

getVoicePitch()   Returns the pitch of the current voice

getVoicePitchRange()   Returns the pitch range of the current voice

getVoicePitchShift()   Returns the pitch shift of the current voice

getVoiceRate()   Returns the rate of the current voice

getVoiceVolume()   Returns the volume of the current voice

isUsingMacTTS()   Returns true if the speech engine is using the built-in Mac Speech API

preload()   Loads all speech resources immediately (on initialization) to avoid any delays on the first utterance -- only necessary if there is a noticeable delay in program execution when speech begins.

setOutputFile()   Will direct output to a file instead of to the system's audio output. To re-enable audio output (the default), pass null to this method.

setVoice()   Sets the current voice by name (default voice='kevin')

Additional 'mbrola' voices can also be enabled if the mbrola binary is installed and the 'mbrola.base' system property has been set by calling:

    RiSpeech.setMbrolaBase("c:\\path\\to\\mbrola\\");


setVoicePitch()   Sets the pitch of the current voice

setVoicePitchRange()   Sets the pitch range of the current voice

setVoicePitchShift()   Sets the pitch shift of the current voice

setVoiceRate()   Sets the rate of the current voice

setVoiceVolume()   Sets the volume of the current voice

speak()   Speaks the text string using the current voice.

stop()   Stops the voice immediately if speaking.

useMacTTS()   Tells the object to use the built-in Mac Speech API for all subsequent utterances, then sets the current voice to voice

RiSpeech.isTTSEnabled()   Returns whether Text-To-Speech is currently enabled

RiSpeech.setMbrolaBase()   Enables support for mbrola voices by specifying the path to the installed mbrola binary.

Note: this method must be called before setting the current voice to an mbrola voice.

RiSpeech.setTTSEnabled()   Set whether Text-To-Speech is currently enabled

Usage Web & Application