How do you change sapi voice pitch mid sentence in vbscript?

102 Views Asked by At

I'm trying to recreate daisy bell with vbs using sapi, but I have a portion of the song that's unpleasantly jarring:

yellow.Rate = 6
yellow.Speak "<pitch middle = '-10'/> Give."
yellow.Speak "<pitch middle = '-8'/> Me."
yellow.Speak "<pitch middle = '-5'/> Your."

Is there a way to adjust pitch mid sentence instead of separating lyrics by pitch so it can be sung more smoothly?

These are the attempts I've made, and although the lyrics are said more smoothly doing these gets rid of any pitch adjustments:

yellow.Speak "<pitch middle = '-10'> Give
           <pitch middle = '-8'> Me
            <pitch middle = '-5'> Your
            </pitch>
           </pitch>
          </pitch>."

and

yellow.Speak "<pitch middle = '-10'/> Give, <pitch middle = '-8'/> Me, <pitch middle = '-5'/> Your."
1

There are 1 best solutions below

2
LesFerch On

Try it with "absmiddle". In the example below, the pitch change is easy to hear:

Set oSapi = CreateObject("sapi.spvoice")
oSapi.Rate = 6
oSapi.Speak "<pitch absmiddle = '-10'/> Give, <pitch absmiddle = '+10'/> Me, <pitch absmiddle = '-10'/> Your."