Mac OS X Speech Synthesis Markup

I put a Sound Blaster 16 in my first computer. It came with a CD-ROM full of goodies like Dr. Sbaitso, the talking psychologist. One app was called TextAssist and it had a special syntax that let you string together phonemes, specifying pitch, duration, even vibrato. I spent hours composing weird robot jingles.

Itsy Bitsy Spider by TextAssist

The built-in text-to-speech on Mac OS also has the ability to sing your melodies through phonemic modifiers and TUNE syntax. (The full specification is available at the link.) TUNE embedded speech commands alter intonation by controlling pitch, word emphasis, pause length, etc. This stuff is baked in, so if you're on a Mac, try highlighting the following code block, control-click, and go Speech > Start Speaking:

[[inpt TUNE]]
1OW {D 1066; P 109.0:0 119.8:12 153.0:30 164.6:39 154.0:50 131.7:62 120.7:69 111.2:73 97.1:89 103.1:93}
h {D 194; P 123.0:0 130.0:12}
1EY {D 652; P 147.0:0 159.0:14 161.0:32 147.3:63 112.0:91}
w {D 161; P 109.0:0}
1AW {D 1171; P 116.0:0 153.3:17 148.2:33 151.0:51 133.0:55 112.4:71 99.5:74 79.0:89 65.7:98 119.0:100}
% {D 293}
D {D 132; P 127.0:0}
IH {D 318; P 160.0:0 136.5:43 114.6:63 112.0:88}
s {D 145; P 112.0:0 119.0:95}
IH {D 189; P 119.0:0 119.0:13 119.0:27 120.0:87 119.0:93}
z {D 180; P 117.0:0 117.0:64 117.0:86 117.0:93}
k {D 80; P 117.0:0 113.0:81 164.0:95}
1UW {D 820; P 164.0:0 168.0:9 172.0:18 169.5:46 139.0:74 116.8:86}
l {D 260; P 104.0:0 92.0:64 104.0:100}
. {D 212}
[[inpt TEXT]]

There's also a simpler mode for phonemic modifiers. The first line here is spoken with default interpretation, and the second line uses the modifiers.  Try it:

You talkin' to me
[[inpt PHON]] [[slnc 500]] [[rate -30]]
+yUW _1tAOl=kIHn ~AX [[pbas +3]]+mIY?
[[inpt TEXT]]

XCode also ships with a hidden gem called Repeat After Me that helps you build this funky syntax from your own spoken phrase. It extracts pitch contour and fits phonetic onsets of a typed phrase to your spoken phrase. 

8 ResponsesLeave a Reply

  1. Nolan Woolley

     /  September 15, 2013 Quote

    Hi Matt, I've been trying to find 'Repeat after me' software. An Apple Developer customer service person directed me to XCode 2.5 What do you think? What I am after is text to speech software that conveys emotions related to excitement ie/ from excitement to...'fever pitch'. Any suggestions would be much appreciated. Cheers Nolan

  2. Julio

     /  July 27, 2016 Quote

    Sorry for asking this so long after the article was written.

    I tried the " highlighting the following code block, control-click, and go Speech > Start Speaking:" on a Mac and it started dictating numbers instead.

    Does this still work?

  3. Yep, still works on my machine 🙂

  4. Does not work. Mavericks.

  5. Bob Leedom

     /  February 5, 2017 Quote

    5 Feb 2017
    Works under Sierra (10.12.3)

    You must highlight the whole block, including the following:
    [[inpt TUNE]]

    Without that, the Mac does indeed start dictating numbers.

  6. Aramis Erak

     /  April 23, 2017 Quote

    Not working for me using Chrome nor Text Edit on 10.12.1 with alternate voices; does work with US voices.

    If it's not working, it may be the voice chosen...

  7. This only works with voices that do not use Apple's more modern TTS engine. Voices that work are:


  8. You forgot to close out the change, oops. Ruined everything !
    Had to reboot speech to text because of this oversight.

    You talkin' to me
    [[inpt PHON]] [[slnc 500]] [[rate -30]]
    +yUW _1tAOl=kIHn ~AX [[pbas +3]]+mIY?[[inpt TEXT]]

Leave a Reply