ken107 / read-aloud

An awesome browser extension that reads aloud webpage content with one click
https://readaloud.app
MIT License
1.31k stars 226 forks source link

Options to enable Google Studio voices #351

Closed stephen-soltesz closed 8 months ago

stephen-soltesz commented 8 months ago

Hello, @ken107, thank you for your commitment to developing and making ReadAloud available. I use it almost every day.

If I understand correctly, the rationale to not enable Google Studio voices in ReadAloud right now are:

Before the voice costs are reduced, are there any conditions under which you would consider allowing ReadAloud users to select Google Studio voices in the official release of ReadAloud sooner?

For my use cases, the quality of the Google Studio voices is worth the increased cost (they're really excellent). I suspect other ReadAloud users already using the premium voices would also welcome the option (even if it's at an increased cost).

In a local build, using Chrome extensions developer mode, I'm able to hard code the voice name, which basically meets my needs.

But, this is a hack and not available to anyone else easily.

If code changes were prepared by me or another contributor, can you imagine accepting PRs that make Google Studio voices available? Could you imagine any of these working?

Or, is there another way that might be simpler than what I can imagine and that you would consider accepting changes to support?

Thank you!

ken107 commented 8 months ago

The risk is only in users accidentally running up a large bill. They may forget they are using a Studio voice, and then read a bunch of articles, running up a bill of 50 dollars, for example. That may not be much to you, but if they run up a few hundred dollars bill, they might bring me to civil court. These voices are 10 times more expensive than the next options, they are meant for commercial use by enterprises.

The free tier is only 100,000 bytes, which is about 15 news articles. If you read 30 articles in the month, you've run up a $16 bill. These voices are meant to be used in studio productions, where the generated audio is saved and usually resold as audio books like Audible. They're not meant for one-off listening like Read Aloud's use case. For saving audio, you'll use a tool like https://ttstool.com/wavenet.html

ken107 commented 8 months ago

Okay, I will accept a PR adding a checkbox in the newly added "Advanced Options" page. The checkbox label may be "Don't hide Google Studio voices". When the checkbox is unchecked, the ttsEngine implementation should filter out Studio voices, and vice versa.

Once this is implemented, I will remove my own filter at the server end, which will cause Studio voices to become available on the client side. And the checkbox will control whether they appear as options on the UI.

nhan000 commented 7 months ago

Hi, after register the API key, I can see many GoogleNeural2 and GoogleWavenet voices, but no Studio voices. Has this been fully implemented yet? I don't see the "Advanced Options" page anywhere in the settings. Thank you!

ken107 commented 7 months ago

Sorry I forgot to remove the filter on the server side. The Studio voices should appear now. Thanks for letting me know. By the way, make sure you know many characters you're consuming and monitor the daily cost in the Google Cloud Console.

nhan000 commented 7 months ago

I still don't see the Google Studio voices? I guess I need to wait for an update from the Chrome Web Store?

Btw, how can I check for the characters/bytes I've consumed? What command do I run in the console? I've click everywhere in the Billing section, but I couldn't find my consumption/billing info. I just registered my GCP account so I have $300 credit so I'm not too worried about it yet but in the future I definitely need to pay close attention to my usage.

ken107 commented 7 months ago

Please go to "Enable Custom Voices", reenter your GCP API key, check the "Enable Studio voices" box, click "Save". The status should show "Google Wavenet and Studio voices are enabled". Then open Options and look for the GoogleStudio voices, which comes after GoogleStandard voices.

This is currently the only way to check how many characters you have used at the end of the day: https://stackoverflow.com/questions/63938975/google-cloud-text-to-speech-character-counts

Be careful with that $300 credit, I'm not sure how it is applied but it's only reducing a few dollars off my bill so far. That credit applies only to specific spending or something like that, I'm not sure.

nhan000 commented 7 months ago

Edit: I see them now. I needed to remove and reinstall the extension for them to show up. Thank you so much!

It indeed shows "Google Wavenet and Studio voices are enabled" but I still don't see the Google Voices. image

Thanks for the warning of the $300 credit. I'll keep a close eye on it and try to find a way to put a cap on my spending.

nhan000 commented 7 months ago

There're also new Google News and Polyglot voices but they're actually much lower quality voices. image