Text-To-Speech Help Needed With AppleScript in Monterey

This newer AppleScript scripting seems to work better in Monterey…

say "It looks like this is working with an updated term called speaking rate" using “Alex” speaking rate 250 pitch 42 modulation 60

Issue : I think my problem is with the RANGES of pitch (maybe per voice?) - if the pitch number is too low or hi for a particular voice - then it has an error.

Q: So is there some way to know the pitch ranges (from xx to xx...) of each Mac Voice like Alex and Susan etc?

Thanks Dave

The documentation says

pitch number: the base pitch frequency, a real number from 0 to 127. Values correspond to MIDI note values, where 60 is equal to middle C. Typical pitches range from around 30 to 40 for a low-pitched male voice to perhaps 55 to 65 for a high-pitched child’s voice.

Are you getting errors for pitch values between 0 and 127? I just ran a few tests and didn't get an error unless the pitch was outside that range.

Hi - Thanks for the help. Only errors are past 127 so that seems to be ok.

I did try this this morning but got odd results. A few older voices like Alex DO work with pitch changes however most newer ones do not work well like Tom - Susan Lee etc.

When I change pitch dramatically - like from 120 down to 20 - then many of the voices have only a tiny change to the voice - hard to describe but gets lower qualities WITHOUT real pitch change. Seems like pitch is just for a few older voices?

Do you have a link for the documentation... I didn't see that part but did find this...

I had the same experience. Alex worked as expected with varying pitch. Samantha sounded weird and basically the same no matter what pitch I gave her. It was only when I removed the pitch specification that she sounded normal.

I didn't provide a link because I don't know of a good one. Apple's online AppleScript documentation is old and incomplete. The entry for say doesn't include any information about pitch, modulation, or speaking rate.

But if you launch Script Editor and open the dictionary (File▹Open Dictionary…) for Scripting Additions, you'll find say in the User Interaction section. That's where I got the excerpt in my answer.

1 Like

Ok great - that is very helpful.

While we are at it - I have never had much luck with 'modulation' either, so I don't use it much. Have you had any luck with modulation?

Apart from the experiments described above, I’ve never used say with any options other than choosing the voice.