I made this function to make the computer speak using the gtts API of google, I made many examples to use it from the script or using a GUI made with tkinter, but never with pygame.
- Building a Text-to-Speech App with Python, Tkinter, and gTTS
- How to use gtts to make a temporary audio file from text and play it on the fly
- How to make An app to create audio from text… using gtts
- How to use gtts module in python as text to speech
- Using gtts on the Mac OS to transform text to audio files
- From text to mp3 with gtts (reading external file)
- Gtts module – TypeError: __init__() got an unexpected keyword argument ‘strict’
- Creare file mp3 da file di testo con gtts
- How to make a quiz with Audio recognition in python with pygame
So, we’re going to do that.
To install it use in the cmd
pip install gtts
Repository
https://github.com/formazione/pygame_speech
Video tutorial
Subscribe to the newsletter for updates
Tkinter templates
My youtube channel
Twitter: @pythonprogrammi - python_pygame