Speech Synthesis Markup Language (SSML)

Description

This tutorial demonstrates how to modify speech synthesis in real-time within your text.

How To Do It

First, I need to give credit where credit is due. I didn't actually created this tutorial - instead, it was inspired and the video was created by Sebediah. I'm merely moving his information into this tutorial for others to find.

If you're looking for the thread that started this conversation, find it here: http://www.ez-robot.com/Community/Forum/Thread?threadId=10743

Sebediah figured out that you can include SSML code in your text to speak. He also created a fantastic tutorial video, which you can see below.

Here's an example of code he provided to give you a head start before the video:


#The  tag is only needed if you're going to make other changes mid-sentence, otherwise you can just use the first tag and don't need the second one after the string.

$VoiceStart = "<prosody pitch ='+230%'>"
$VoiceEnd = "</prosody>"

SayWait($VoiceStart + "When I'm tired my voice gets very deep and I speak slowly" + $VoiceEnd)


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

PRO
USA
#1   — Edited

I copied this code from the video , to my ARC, can't get it to work, have any reasons?

thanks

PRO
Canada
#2  

What errors are popping up in your debug window?

I also know that copying and pasting quotation marks sometimes has issues in EZ-script. It's just a guess but I think that sometimes the quotation marks might be entered as a double prime instead.

PRO
USA
#3  

Program runs well, only with the same voice, not high, or low , just normal

PRO
USA
#4  

@EZang60

Did you watched the video  ?

$VoiceStart = ""
$VoiceEnd = ""

The above code is incorrect (maybe a copy paste error)

look to the video screenshot:

User-inserted image

PRO
USA
#5   — Edited

Here is my code:

$VoiceStart = "<prosody pitch ='100%'>" $VoiceStart2 = "<prosody  pitch='130%'>"  $VoiceStart3 = "<prosody pitch='-50%'>" $VoiceEnd = "</prosody>"

SayWait($VoiceStart + "I am here a normal voice" + $VoiceEnd) SayWait($VoiceStart2 + "I am here a high voice" + $VoiceEnd) SayWait($VoiceStart3 + "I am here a low voice" + $VoiceEnd)

I copied the code directly from the video

Program runs well, only with the same voice, not high, or low , just normal

PRO
Belgium
#6   — Edited

Ezang your missing this key , +

PRO
Belgium
#7   — Edited

Ezang your missing this key, +

PRO
USA
#8   — Edited

@Nomad: I don't think so.

@DJ: Something is wrong with the server date ?

PRO
USA
#9   — Edited

@DJ: The tags "<" ">" are ignored. Something changed ?

PRO
USA
#10   — Edited

I copied directly from the video

Program runs well, only with the same voice, not high, or low , just normal

PRO
USA
#11   — Edited

I copied the code directly from the video

Program runs well, only with the same voice, not high, or low , just normal

PRO
USA
#12  

Nomad

what am I missing?

the +   where?

PRO
USA
#14  

I took out the  + and it is still the same

PRO
Belgium
#15  

i am looking to see if it works here.moment.

PRO
USA
#16  

I give up   lol  :-)

PRO
USA
#17  

Nomad 6r Did it work?

PRO
Belgium
#18  

still trying.but i typ all in.

PRO
USA
#19  

I tried many combinations - no luck, all the same voice

PRO
Belgium
#20  

sofar here too but also he says all above numbers  and letters.

PRO
USA
#21  

$VoiceStart = "(prosody pitch = '+100%')" $VoiceStart2 ="(prosody pitch = '+230%')" $VoiceStart3 = "(prosody pitch = '-50%')" $VoiceEnd = "</prosody>"

SayWait($VoiceStart + "normal voice" + $VoiceEnd) SayWait($VoiceStart2 + "high voice" + $VoiceEnd) SayWait($VoiceStart3 + "low voice"+ $VoiceEnd)

same voice

PRO
Belgium
#22  

you have to use SayEzb if you want the voice come out the robot. if you use say alone it comes out the speaker.

PRO
USA
#23  

I will try the robot

PRO
USA
#24  

$VoiceStart = "(prosody pitch = '+100%')" $VoiceStart2 ="(prosody pitch = '+230%')" $VoiceStart3 = "(prosody pitch = '-50%')" $VoiceEnd = ""

SayEZBWait($VoiceStart + "normal voice" + $VoiceEnd) SayEZBWait($VoiceStart2 + "high voice" + $VoiceEnd) SayEZBWait($VoiceStart3 + "low voice"+ $VoiceEnd)

same voice out of the robot

PRO
Belgium
#25  

User-inserted image

there are no 4 lines in the above chapter,i only 3 i see in the video. but indeed it doesn work .

PRO
USA
#26  

lol, no matter how many lines it does not work

thanks anyway

PRO
USA
#27   — Edited

This works in EZB scripts, all you need

ControlCommand("Speech Settings", "SetVoiceRate", "slow") saywait("I am speaking slow")

ControlCommand("Speech Settings", "SetVoiceRate", "Fast") saywait("Now i am speaking fast")

#Too fast to hear #ControlCommand("Speech Settings", "SetVoiceRate", "ExtraFast") #saywait("Now i am speaking extrafast")

ControlCommand("Speech Settings", "SetVoiceRate", "ExtraSlow") saywait("Now i am speaking super slow")

#29   — Edited

Hello,

All the examples here are wrong. You have a syntax errors:

$VoiceStart = "(prosody pitch = '+100%')"

You have spaces before and after the equal (=) sign and the angle brackets are replaced with parenthesis.

If you remove the spaces IT WORKS!!! (and don't forget that this page is removing the angle brackets. You have to put them back in. Parenthesis don't work in the variable declaration!)

try the code below in the picture and watch out for the added spaces and parenthesis.

User-inserted image

PRO
Belgium
#30   — Edited

thomasfromla

many thanks for the solution.mine looks like this.

$VoiceStart2 = "<prosody pitch='-70%'><prosody rate='.200'>" $VoiceStart3 = "<prosody pitch='-70%'><prosody rate='.100'>"

say($voicestart2 + " high voice ") say($voicestart3 + " low voice ")

PRO
USA
#31  

This works in EZB scripts, all you need

ControlCommand("Speech Settings", "SetVoiceRate", "slow") saywait("I am speaking slow")

ControlCommand("Speech Settings", "SetVoiceRate", "Fast") saywait("Now i am speaking fast")

#Too fast to hear #ControlCommand("Speech Settings", "SetVoiceRate", "ExtraFast") #saywait("Now i am speaking extrafast")

ControlCommand("Speech Settings", "SetVoiceRate", "ExtraSlow") saywait("Now i am speaking super slow")

EzAng

PRO
Belgium
#32  

hi ezang

thats another i see.am gonna try this in 2 houres .

thanks

PRO
USA
#33   — Edited

Make sure you have the speech synthesis setting open and add a script

#This works in EZB scripts, all you need controlCommand("Speech Settings", "SetVoiceEmphasis", "Strong")

ControlCommand("Speech Settings", "SetVoiceRate", "slow") saywait("I am speaking slow")

ControlCommand("Speech Settings", "SetVoiceRate", "Fast") saywait("Now i am speaking fast")

#Too fast to hear #ControlCommand("Speech Settings", "SetVoiceRate", "ExtraFast") #saywait("Now i am speaking extrafast")

ControlCommand("Speech Settings", "SetVoiceRate", "ExtraSlow") saywait("Now i am speaking super slow")

User-inserted image

User-inserted image

Use the AudioToolbox control - add a script with - ControlCommand("AudioToolbox Plugin", "ImportUWPVoices")

look at the Cheat Sheet in the script, many men and ladies voices

I added :

#This works in EZB scripts, all you need controlCommand("Speech Settings", "SetVoiceEmphasis", "Strong")

controlCommand("Speech Settings", "SetVoice", "Microsoft David Desktop") ControlCommand("Speech Settings", "SetVoiceRate", "slow") saywait("I am speaking slow, what do you think")

controlCommand("Speech Settings", "SetVoice", "Microsoft Zira Desktop") ControlCommand("Speech Settings", "SetVoiceRate", "Fast") saywait("Now i am speaking fast, can you make me out")

#Too fast to hear #ControlCommand("Speech Settings", "SetVoiceRate", "ExtraFast") #saywait("Now i am speaking extrafast")

controlCommand("Speech Settings", "SetVoice", "Microsoft George") ControlCommand("Speech Settings", "SetVoiceRate", "ExtraSlow") saywait("Now i am speaking super slow, are you sleeping")

controlCommand("Speech Settings", "SetVoice", "Microsoft Hazel Desktop") controlCommand("Speech Settings", "SetVoiceRate", "Medium") saywait("Now i am speaking medium")

controlCommand("Speech Settings", "SetVoice", "Microsoft James") controlCommand("Speech Settings", "SetVoiceRate", "NotSet") saywait("Now my voice speed is not set")

EzAng

#34  

So far setting these parameters have worked for me: - Break strength (pauses)  -Speech rate - Pitch by relative pitch, absolute pitch and slow/default/fast, etc. - Volume  - Emphasis

  • Phonemes (for special pronunciations)

(see Cepstral SSML)

PRO
USA
#35  

I don't have Cepstral voices, I just use the hidden windows voices, as you can see it is enough for me :-)

User-inserted image

EzAng

#36   — Edited

Everyone should note that some of these do not work with Microsoft voices. I have both MS and Cepstral voices. Nearly all of them work for Cepstral. Also, it seems that "contour" was not fully implemented. It changes the pitch but does not work beyond that. Or perhaps I just don't know the proper syntax.

--Thomas