Google TTS makes 4 character API call every time
-
Hi,
Thanks for the great plugin. We have one major issue though:
When using Google TTS, the plugin makes an API call with the word “test” on every page load. We have a site with about half a million page loads a month, so this means that it uses 2 million characters every month, and since it uses WaveNet voice for this test, we exceed Google’s free quota of 1million characters every month.
to stop the invoicing, I made some debugging and found that the admin\class-say-it-admin.php constructor is called every time a page loads. There is a call $this->authenticate_google_service(); And in the same class the authenticate_google_service() does a test call to the Google TTS service. It seems to me that the call is not needed at all, so I just commented out the line in constructor. Other option to reduce the load to the API would be to change the test call to be just ‘t’ (so it would be 1 character instead of 4) and to change it to use Standard voice instead of Wavenet voice. (Standard voice has 4million free quota, Wavenet has only 1 million).
I tested and confirmed this functionality with a clean WP installation.
Also, I am not actually sure, if the plugin works with Google TTS anymore, since after adding the JSON key, i get the following error:
Fatal error: Uncaught Error: Call to undefined function Google\Protobuf\Internal\bccomp()
We have built our own plugin to extend the Say it functionality, so for us the plugin still works but I think the standard installation does not work anymore.
- The topic ‘Google TTS makes 4 character API call every time’ is closed to new replies.