Javadoc link

This text to speech synthesis service use local operating system text to speech engine.

MacOs :

Just set your voice, inside control panel
You can test it using say "something" inside terminal

http://cdn.osxdaily.com/wp-content/uploads/2011/07/add-new-voices-to-os-x-lion.jpg

 

Windows :

For information there is a little tool that do the magic in background ( tts\tts.exe ). This is transparent for you.

By default there is not a lot of voices, but you can add what you want inside your local system. Free or Paid SAPI voices ( mbrola / best-of-vox.com etc ... )

How to Unlock Mobile Text-To-Speech Voice in Windows 10 ( creator update , if you have corresponding language pack )

Download reg files : www.myai.cloud/mrl/mobile.windows10.zip

By default, the Microsoft mobile voice is locked for using in text-to-speech software via SAPI 5. You can unlock it with a simple registry tweak. Download the archive, extract the file for your language and for your version of the operating system ("mobile_x86.reg" for 32bit and "mobile_x64.reg" for 64bit), click the right mouse button on the file's name and choose the context menu item "Merge". The Microsoft mobile voice will appear in the list of the available voices

You can check voice list using

python command : print microsoftlocaltts.getVoices();
dos command : tts\tts -V

Linux : TODO

Example code (from branch develop):
#########################################
# LocalSpeech.py
# description: used as a general template
# categories: speech
# more info @: http://myrobotlab.org/service/LocalSpeech
#########################################
import os
import platform
 
# start the service
mouth = runtime.start('mouth','LocalSpeech')
 
# by default LocalSpeech will select a command template appropriate for the current 
# operating system
mouth.speakBlocking("this is how I sound out of the box")
 
# possible voices ( selected voice is stored inside config until you change it )
mouth.speakBlocking("these are the voices I can have " + str(mouth.getVoices()))
mouth.speakBlocking ("this is the voice I am using " + str(mouth.getVoice()))
 
if (Runtime.getPlatform().isLinux()):
    mouth.speakBlocking('I appear to be on a Linux system')
    mouth.speakBlocking('I can also use espeak for speech')
    mouth.setEspeak()
    mouth.speakBlocking('this is what espeak sounds like')
 
if (Runtime.getPlatform().isWindows()):
    mouth.speakBlocking('I appear to be on a Windows system')
    mouth.speakBlocking('I can also use mimic for speech')
    mouth.setMimic()
    mouth.speakBlocking('this is how mimic speech sounds')
 
if (Runtime.getPlatform().isMac()):
    mouth.speakBlocking('I appear to be on a Mac OS system')
 
# set your voice from macos control panel
# you can test it using say command from terminal
 
# mouth.setVoice("Microsoft Zira Desktop - English (United States)")
mouth.speakBlocking(u"Hello this is an english voice")
mouth.speakBlocking(u"Bonjour ceci est une voix française, je teste les accents aussi avec le mot éléphant")
 
mouth.setVolume(0.7)
mouth.speakBlocking("I have lowered my volume")
mouth.speakBlocking("Silent please")
mouth.setMute(True)
mouth.speakBlocking("you cannot hear me")
mouth.setMute(False)
Example configuration (from branch develop):
!!org.myrobotlab.service.config.LocalSpeechConfig
blocking: false
listeners: null
mute: false
peers:
  audioFile:
    autoStart: true
    name: localspeech.audioFile
    type: AudioFile
replaceChars: null
speechRecognizers: null
speechType: null
substitutions: null
type: LocalSpeech
voice: null