## FILE DESCRIPTION # File: testspeech.py # Partly based on soul.py # Description: Testing the new Acapelo interface. # Following http://www.aldebaran-robotics.com/documentation/naoqi/audio/altextto speech-tuto.html from naoqi import ALProxy ttsProxy = ALProxy('ALTextToSpeech', '127.0.0.1', 9559) # The tts remembers the previous settings, so you should go back to default settings ttsProxy.loadVoicePreference("NaoOfficialVoiceEnglish") #ttsProxy.setParameter("pitchShift", 0) #ttsProxy.setVoice("Kenny22Enhanced"); #ttsProxy.setLanguage("English"); ttsProxy.say("Hello World!") #ttsProxy.setParameter("pitchShift", 0.8) # correct range is 1.0 - 4, or 0 to disable #This is really high!!! #ttsProxy.say("A little bit higher:") #ttsProxy.setParameter("pitchShift", 1.5) #ttsProxy.say("A little bit higher:") #ttsProxy.setParameter("pitchShift", 2.0) #ttsProxy.say("A little bit higher:") #ttsProxy.setParameter("pitchShift", 3.0) #ttsProxy.say("A little bit higher:") #ttsProxy.setParameter("pitchShift", 4.0) #ttsProxy.say("A little bit higher:") #This is understandable! #ttsProxy.say("A little bit higher:") #ttsProxy.setParameter("pitchShift", 1.1) #ttsProxy.say("A little bit higher:") #ttsProxy.setParameter("pitchShift", 1.2) #ttsProxy.say("A little bit higher:") #ttsProxy.setParameter("pitchShift", 1.3) #ttsProxy.say("A little bit higher:") #ttsProxy.setParameter("pitchShift", 1.4) #ttsProxy.say("Hello World!") #ttsProxy.setParameter("pitchShift", 0) lang = ttsProxy.getAvailableLanguages(); print "Available languages: " + str(lang) voices = ttsProxy.getAvailableVoices(); print "Available voices: " + str(voices) #ttsProxy.setVoice("Kenny22Enhanced"); #ttsProxy.say("Kenny says: Hello World!") #ttsProxy.setLanguage("French"); #ttsProxy.setVoice("Julie22Enhanced"); #ttsProxy.say("Jullie dites: Bonjour tout le Monde!") ttsProxy.setParameter("doubleVoice", 1) ttsProxy.setParameter("doubleVoiceLevel", 0.5) ttsProxy.setParameter("doubleVoiceTimeShift", 0.1) ttsProxy.setParameter("pitchShift", 1.1) ttsProxy.say("The robot says: Hello World!")