chrisjp / tts

A simple tool to demo text-to-speech using various services' voices. HTML5 and Vanilla JS.
https://lazypy.ro/tts
MIT License
63 stars 12 forks source link

Google Translate audio URLs return 404 #9

Closed chrisjp closed 1 year ago

chrisjp commented 1 year ago

When "hotlinking" Google Translate audio URLs in an <audio> tag a 404 is returned, this is in spite of the URL functioning as normal when accessed directly in the browser. To workaround this we should fetch (via proxy.php) if possible and save the mp3 locally if enabled, if not, we should provide a data URI so the audio is at least playable.

If this workaround fails we may as well remove the voices.