Macos – Mac OS X – Quickly change voices for Text-to-Speech

macmacostext to speech

I love the text to Speech feature of Mac OS X. Since I'm not a native English speaker I'm very happy about all the additional languages added since Lion came out. However, I do use English as well as my native language (German). Changing voices is a bit of a pain. It just requires too many steps to be comfortable.

Is there any way to make this easy? I was looking for shortcuts, maybe a drop down menu somwhere up in the right corner, anything would be fine.

Since my search was not successful, I hope to find some advice here on SuperUser. Thanks a lot!

cu
Roman

Best Answer

I have used FastScripts to assign a shortcut to this script:

try
    set old to the clipboard as record
end try
try
    tell application "System Events" to keystroke "c" using command down
    delay 0.05
    say (the clipboard) using "Kyoko"
end try
try
    set the clipboard to old
end try

You could also create a service in Automator:

There is a bug in 10.7 and 10.8 where the shortcuts for Automator services don't always work until you hover over the services menu from the menu bar. WorkflowServiceRunner can also use over 100% CPU while speaking text.

Another option would be to use UI scripting to change between two voices:

tell application "System Preferences"
    reveal anchor "TTS" of pane "com.apple.preference.speech"
end tell
tell application "System Events" to tell process "System Preferences"
    tell pop up button 1 of tab group 1 of window 1
        click
        delay 0.1
        if value is "Alex" then
            click menu item "Victoria" of menu 1
        else
            click menu item "Alex" of menu 1
        end if
    end tell
end tell
quit application "System Preferences"

Changing the SelectedVoiceID key in com.apple.speech.voice.prefs.plist also works, but I don't know how to apply the changes immediately.

Related Question