mklement0 / voices

macOS CLI for changing the default TTS (text-to-speech) voice and printing information about and speaking text with multiple voices.
62 stars 4 forks source link

Some installed voices are identified as uninstalled #7

Open serrano-s opened 3 years ago

serrano-s commented 3 years ago

Hello, and thanks for this repo, it's really cool! I'm running macOS 12.0.1, and I'm having trouble getting the macOS service version of switching between default voices to find some downloaded voices. I just downloaded the macOS service to switch between default voices as described in the documentation here, and modified just the one indicated line in ~/.SwitchDefaultVoice-rc so that it now reads

voices=( Fred Kathy )

Like I said, I'm running macOS 12.0.1, so the System Preferences seem to have been shuffled around/renamed a little bit from the "Speech" header referenced in this repo's documentation. If I go to System Preferences > Accessibility > Spoken Content and look through the System Voice dropdown menu, which if I'm not mistaken is where the "Speech" content moved, Fred and Kathy both appear as options:

Screen Shot 2021-11-09 at 10 47 14 PM

Let's say that I've just manually changed the default voice to Kathy. When I use the keyboard shortcut I assigned for the switch default voice command, I get the following error message, read in the Kathy voice:

The action “Run Shell Script” encountered an error: “Print: Entry, "VoiceAttributes:VoiceLocaleIdentifier", Does Not Exist voices: ERROR: 'Fred' is not an installed voice.”

If I then go to my System Preferences window, manually switch the default voice to Fred, and then rerun the switch default voice command, I get basically the same error message, with the only change being that it tells me in the Fred voice that 'Kathy' is not an installed voice.

However, if I then manually change the default voice to Fred and then change that one line in ~/.SwitchDefaultVoice-rc so that it instead reads

voices=( Fred Monica )

(you can see from my screenshot that Monica is also a voice I have installed on my computer), and rerun the keyboard shortcut command, it correctly says "español" in the Monica voice. But if I then rerun the command again, I get the same error message as earlier about Fred not being installed, just this time read in the Monica voice.

I wasn't sure whether this was somehow a language-based issue, so I tried switching the config file to read

voices=( Chantal Monica )

but once again, switching from a manually-set Chantal to Monica is fine, but not the other way around. So I'm not sure what the pattern is here.

In summary: of the downloaded voices I've tried switching between, trying to automatically switch to Alex, Kathy, Fred, or Chantal throws an error, and automatically switching to Monica works fine. Any ideas as to what might be going on? Not sure whether to blame the new OS or whether that's a red herring here. Thanks for your time!

mklement0 commented 3 years ago

I'm glad to hear you find the project useful, and thanks for bringing this issue to my attention.

I can take a closer look once I have upgraded to macOS 12, but I don't know when I'll get around to it.

serrano-s commented 3 years ago

Sounds good, no rush! Thanks for replying in the meantime.

huyz commented 9 months ago

Hmm, I can't get any of my voices to be recognized as installed.

mklement0 commented 9 months ago

Thank you for letting me know, @huyz.

Unfortunately, voices seems to be partially broken as of Sonoma (macOS 14). For now I've added a prominent warning to the top of the README

I haven't looked at this project in a long while, and unfortunately I can't make promises as to if and when I may be able to fix it.