Learn to Code via Tutorials on Repl.it!

← Back to all posts
A quick guide to the gTTS Library.
LoganSpong

Ok, have you ever wanted a voice in your repl?
I'm here to help. This is..

gTTS for people who don't have time!

gTTS stands for Google Text-to-Speech. It's that voice you hear in Google Translate and other Google apps and products use it as well.

Ok! I know you guys just want to see the code, so let's get on with it!

Step 1: Install the gTTS library.

Step 2: Declare what you want it to say.

Step 3: Save that .mp3 file.

Step 4:

Run the program. In your "files" sidebar, you should see something like: hello.mp3.
Play it!

Voters
RiccardoGuerra
SpaMight
HarshGadiya
ShivankChhaya
RaidTheWeb
studentAlfredAl
LoganSpong
Comments
hotnewtop
RaidTheWeb

@LoganSpong here is an idea for your aspiring mind, try make a python library that uses the gTTS library and the new repl.it audio library to allow actual tts. Good luck and once again good job

RaidTheWeb

I fact now that I think about it maybe I might make something like that. owo

LoganSpong

@RaidTheWeb Repl.it "play" function only allows .wav and .aiff files. Not .mp3 files. But good idea anyways!

EthanClark2

How do I get the file to save into a folder?

LoganSpong

@EthanClark2 os.chdir(folder) should work.

ShivankChhaya

Nice! What language is this in? By my guess, I have a feeling it is python because of the importing format.

LoganSpong

@ShivankChhaya Right. It is python

studentAlfredAl

You continue to amaze me! Great job and keep it up :)

LoganSpong

@studentAlfredAl Thanks! Also, if you like my posts, check out My emoticon dictonary project

LoganSpong

@studentAlfredAl Did it work?

studentAlfredAl

I did, it was good :) @LoganSpong