A quick guide to the gTTS Library.
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.
from gtts import gTTS
Step 2: Declare what you want it to say.
from gtts import gTTS tts = gTTS('Hello gTTS')
Step 3: Save that .mp3 file.
from gtts import gTTS tts = gTTS('Hello gTTS') tts.save('hello.mp3')
Step 4:
Run the program. In your "files" sidebar, you should see something like: hello.mp3.
Play it!
How do I get the file to save into a folder?
@EthanClark2 os.chdir(folder) should work.
Nice! What language is this in? By my guess, I have a feeling it is python because of the importing format.
@ShivankChhaya Right. It is python
You continue to amaze me! Great job and keep it up :)
@studentAlfredAl Thanks! Also, if you like my posts, check out My emoticon dictonary project
@studentAlfredAl Did it work?
I did, it was good :) @LoganSpong
@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
I fact now that I think about it maybe I might make something like that. owo
@RaidTheWeb Repl.it "play" function only allows .wav and .aiff files. Not .mp3 files. But good idea anyways!