M HYPE SPLASH
// news

I accidentally corrupted a plist file belonging to the speech synthesis server, how do I fix it?

By John Campbell

I was trying to write an AppleScript that would recognize the language of a selected text, and then set the speech synthesis voice accordingly and then let my Mac speak the text out loud.

This is how far I got:

on run {input, parameters} set txt to (quoted form of (input as string)) set resp to do shell script "curl -s -H 'Authorization: Bearer <my api key>' -d q=" & txt & " | /usr/local/bin/jq '.data.detections[0].language'" set isDutch to resp is equal to "\"nl\"" if isDutch then do shell script " defaults write com.apple.speech.voice.prefs SelectedVoiceID 5190 defaults write com.apple.speech.voice.prefs SelectedVoiceName 'Pieter Siri' " else do shell script " defaults write com.apple.speech.voice.prefs SelectedVoiceID 101 defaults write com.apple.speech.voice.prefs SelectedVoiceName 'Nora Siri' " end if do shell script " killall SpeechSynthesisServer pkill com.apple.speech.speechsynthesisd " -- and then here I was gonna try and see if I could -- press option+esc to trigger my Mac's native text to speech feature. return input
end run

I thought I had figured out how to correctly set those settings, but apparently I was mistaken, because now text to speech doesn't work anymore and when I try to open it in System Preferences I see this:

error in system preferences

3

1 Answer

Okay, the solution, which I learned from a user on reddit, was to delete my com.apple.speech.voice.prefs.plist file. It reset all my voice related settings, but that's better than a full reinstall.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy