Requires Anki 2.1.20 or later.
This add-on is an example of how third-party TTS services can be plugged into Anki 2.1.20.
If you're an end user wanting to add audio to your cards, consider using the AwesomeTTS add-on instead, which is better supported: https://ankiweb.net/shared/info/1436550454
If you do want to use this add-on, once installed, you can use the following in your card template to read the Front field aloud:
{{tts en_US voices=gTTS:Front}}
Replace en_US with the language of your choice. For more on TTS, please see https://apps.ankiweb.net/docs/manual.html#text-to-speech
Source available at https://github.com/ankitects/anki-addons/blob/master/code/gtts_player/init.py
Update 2023-06-07: Fix issues by updating to latest gtts library (thanks to looi).