Vocab-Apps / anki-hyper-tts

HyperTTS Addon for Anki
GNU General Public License v3.0
64 stars 8 forks source link

MacOS (OS X) speech synthesis option missing in HyperTTS, available in AwesomeTTS #162

Open zimmermatt opened 4 months ago

zimmermatt commented 4 months ago

I didn't notice there was a new, preferred, plug-in. So I installed AwesomeTTS v1.85 and successfully generated several audio files using the built-in MacOS facility (OS X Speech Synthesis in the Generate using dropdown list).

I later saw that HyperTTS was recommended, so I migrated to it and found that option is no longer available.

If this was unintentional, it would be nice to have it restored. If intentional, I'm interested to know the rationale.

Thanks!

2600box commented 1 month ago

I just switched from AwesomeTTS to HyperTTS and noticed the same thing.

In AwesomeTTS there was a limited list of voices in the drop-down menu, not reflective of those installed through MacOS preferences.

As @zimmermatt has stated, the entire OSX/MacOS TTS option appears to be missing from HyperTTS.

2600box commented 1 month ago

For awesomeTTS I have made a pull request that fixes the missing voices here: https://github.com/AwesomeTTS/awesometts-anki-addon/pull/321

luc-vocab commented 1 month ago

I've been meaning to add MacOSX voices, at some point I asked for people's help to test it out but didn't find any volunteers. I need to figure out how to get access to a Mac VM for testing, after that I should be all set.

jbvoigt3 commented 1 month ago

I'm a Mac and Windows user. Happy to help to test.

Respectfully,

Jack Voigt @.***

"We are free to choose, but we are not free from the consequences of our choice."

On Thu, May 23, 2024 at 2:19 AM Luc @.***> wrote:

I've been meaning to add MacOSX voices, at some point I asked for people's help to test it out but didn't find any volunteers. I need to figure out how to get access to a Mac VM for testing, after that I should be all set.

— Reply to this email directly, view it on GitHub https://github.com/Vocab-Apps/anki-hyper-tts/issues/162#issuecomment-2125932261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKD2ZAL3O3I26X75RFAZD23ZDURWLAVCNFSM6AAAAABDYNGYWWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRVHEZTEMRWGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

2600box commented 1 month ago

I've been meaning to add MacOSX voices, at some point I asked for people's help to test it out but didn't find any volunteers. I need to figure out how to get access to a Mac VM for testing, after that I should be all set.

Happy to help test. I tried make my own module for HyperTTS but did not succeed.

zimmermatt commented 1 month ago

I've been meaning to add MacOSX voices, at some point I asked for people's help to test it out but didn't find any volunteers. I need to figure out how to get access to a Mac VM for testing, after that I should be all set.

Happy to help test. I tried make my own module for HyperTTS but did not succeed.

Thanks @luc-vocab and @2600box. Same here. I have a Mac I can test on.

I had hoped to submit a PR along with this issue. When I took a look it became clear it was going to take a little time to understand all the moving pieces and how to slot a new service using the new abstract service design. I wanted to submit the issue in the case that someone else had the spare time and inclination to complete this.

zimmermatt commented 1 month ago

Given there seems to be at least some interest, I spent the time to figure out how to add this. I've opened https://github.com/Vocab-Apps/anki-hyper-tts/pull/178. @luc-vocab ... I'm expecting what I've done isn't completely correct, so feedback is highly welcome.

I wasn't able to successfully run test_tts_services.py. There is a hard dependency on at least one of the API keys for verifying the audio (verify_audio_output()). The test passed up until that point though.

I was able to modify package.sh to build the add-on locally and do a smoke test. I was able to successfully add audio to some cards and that audio matched what AwesomeTTS generated. I don't know the HyperTTS UI that well and couldn't find where to configure the speech rate, so that was not tested.

Maybe a follow on enhancement request would be to have the convenient "Pronounce with ..." that AwesomeTTS adds to the Anki main screen (if it's not already implemented in HyperTTS).

Please let me know of any comments, suggestions, and feedback you may have.

luc-vocab commented 1 month ago

Awesome @zimmermatt this is a very welcome change, I finally found a service which lets me rent a Mac Mini M1 and access it by ssh (Scaleway) and i'll be testing your change today.

luc-vocab commented 1 month ago

Can someone help test this release which contains the MacOSX service ? https://github.com/Vocab-Apps/anki-hyper-tts/releases/tag/v1.10.0 thank you @zimmermatt for writing it.

2600box commented 1 month ago

Can someone help test this release which contains the MacOSX service ? https://github.com/Vocab-Apps/anki-hyper-tts/releases/tag/v1.10.0 thank you @zimmermatt for writing it.

I tested it with anki 24.04 and MacOS 13.6.7 and it seems to work well. Thanks to @zimmermatt and @luc-vocab for putting it together so quickly!

zimmermatt commented 1 month ago

Can someone help test this release which contains the MacOSX service ? https://github.com/Vocab-Apps/anki-hyper-tts/releases/tag/v1.10.0 thank you @zimmermatt for writing it.

I tested it with anki 24.04 and MacOS 13.6.7 and it seems to work well. Thanks to @zimmermatt and @luc-vocab for putting it together so quickly!

Nice! Thanks for testing @2600box!

... and thanks for merging this in so quickly, @luc-vocab!

2600box commented 1 month ago

I have noticed some minor issues that don't affect the function.

I see some duplication of available voices, with no apparent differentiation.

The voice that I use is Audrey (French) and it shows this voice as male.

Cheers

luc-vocab commented 1 month ago

Which voice appears duplicated ? I will fix the gender for Audrey. Did you install any particular voice packs ? It was not available on the MacOSX machine I tested. Maybe you can teach me how to install this voice ?

2600box commented 1 month ago

On 10.13 at least, in System settings under Accessibility there is an area for Spoken Content. When you click on System voice there is an option to Manage Voices and you can download more there.

Looking at it now, I can see I have see two Thomas voices. The default and the enhanced. That is why it appears as a duplicate in HyperTT.

Screenshot 2024-05-26 at 13 44 57 Screenshot 2024-05-26 at 13 43 48 Screenshot 2024-05-26 at 13 43 44

luc-vocab commented 1 month ago

I'm glad your raised this, I will look into it

zimmermatt commented 1 month ago

Neat find. Thanks @2600box!

I'm going to make a quick PR with an improvement to the regex (the description can end up containing both trailing close parentheses as it currently stands - e.g., French (France)) instead of the desired French (France)).

I'll leave it to @luc-vocab to decide how to handle differentiating the alternative voice variations.

zimmermatt commented 1 month ago

PR enhancing the regex submitted.

luc-vocab commented 1 month ago

Question: I've installed French voices:

(anki-hyper-tts) m1@13c2cb00-edaa-4bd8-af6f-211a61fba3f5 anki-hyper-tts % say -v '?' | grep Aud               
Aude                fr_BE    # Bonjour, je m’appelle Aude.
Aude (Enhanced)     fr_BE    # Bonjour, je m’appelle Aude.
Audrey              fr_FR    # Bonjour, je m’appelle Audrey.
Audrey (Enhanced)   fr_FR    # Bonjour, je m’appelle Audrey.
Audrey (Premium)    fr_FR    # Bonjour, je m’appelle Audrey.

Do we not want to provide access to all 3 Audrey voices ?

With @zimmermatt 's latest PR, only one Audrey voice appears and I don't know which one it is.

zimmermatt commented 1 month ago

Hmmm... When I run a little sample script that duplicates the logic all three show up.

I'm afk until this afternoon. I can look at the committed code again then.

I do agree now though that all should be presented, since the enhanced/premium voices are quite good.

On Mon, May 27, 2024, 10:32 Luc @.***> wrote:

Question: I've installed French voices:

(anki-hyper-tts) @.*** anki-hyper-tts % say -v '?' | grep Aud Aude fr_BE # Bonjour, je m’appelle Aude. Aude (Enhanced) fr_BE # Bonjour, je m’appelle Aude. Audrey fr_FR # Bonjour, je m’appelle Audrey. Audrey (Enhanced) fr_FR # Bonjour, je m’appelle Audrey. Audrey (Premium) fr_FR # Bonjour, je m’appelle Audrey.

Do we not want to provide access to all 3 Audrey voices ?

  • Audrey
  • Audrey (Enhanced)
  • Audrey (Premium) And let the user decide which one they want ?

With @zimmermatt https://github.com/zimmermatt 's latest PR, only one Audrey voice appears and I don't know which one it is.

— Reply to this email directly, view it on GitHub https://github.com/Vocab-Apps/anki-hyper-tts/issues/162#issuecomment-2133605880, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGCA2KOD6XJ6VTYQQ2Y6DDZEM7YJAVCNFSM6AAAAABDYNGYWWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZTGYYDKOBYGA . You are receiving this because you were mentioned.Message ID: @.***>

luc-vocab commented 1 month ago

Please wait, I will try it again and make sure. Just wanted to agree we should present all three voices to the user.

luc-vocab commented 1 month ago

Please try this release: https://github.com/Vocab-Apps/anki-hyper-tts/releases/tag/v1.10.1

2600box commented 1 month ago

I had a chance to try. The only thing I notice that all French voices are marked as male.

Screenshot 2024-05-30 at 10 29 41

luc-vocab commented 1 month ago

OK, please try this updated version: https://github.com/Vocab-Apps/anki-hyper-tts/releases/tag/v1.10.2 I tried to map all the voices to a gender.

2600box commented 1 month ago

OK, please try this updated version: https://github.com/Vocab-Apps/anki-hyper-tts/releases/tag/v1.10.2 I tried to map all the voices to a gender.

Seems good to me. Cheers