Make TTS mp3s with Google Translate voices
(about 15min setup)

1. get Python programming language

official site download link: download

2. add Python to path

need to add to path to do next steps.
we'll be able to run Python scripts without typing extra file location info now.

default settings on [Install Now] should be good.

3. open Command Prompt

use the search in the start menu.
search for [Command Prompt]

4. add gTTS(Google Text-To-Speech) to Python

more info about gTTS: gTTS documentation
we're entering 3 commands (enter 1 line at a time):
leave command prompt open after entering commands
cd %homepath%
mkdir tts-folder && cd tts-folder
pip install gTTS
what this does:

  1. goes to your user's home folder (in case Command Prompt opens somewhere weird)
  2. makes a folder called [tts-folder] and goes into it
  3. adds Google TTS code to Python

5. go to tts-folder and add new file

this folder should be at C:\Users\[your username]\tts-folder
right-click / then look for New / then Text Document
rename it to tts.py
hit yes.

6. open tts.py with IDLE (Python's text editor)

right-click / then look for [Edit with IDLE] / then [Edit with IDLE]

7. write (copy n paste) the script

what the code does (3 sections):

  1. section one - add options to the script so you can change the read text and language
  2. section two - generates the TTS, saves in it a file (output.mp3 by default)
  3. section three - if you use the '--play' option this plays output.mp3 after generating it

# SECTION ONE - COMMAND PROMPT OPTIONS
##  add text, filename, language, and play options
##  so you don't have to rewrite the script ----------------------------------------------

import argparse

parser = argparse.ArgumentParser(
    description="generates TTS files with Google Translate voices."
)

parser.add_argument("-t","--text", help="text in quotes you want to read: \"like this\"")
parser.add_argument("-f","--filename", help="tts output filename (no spaces): like-this")
parser.add_argument("-l","--lang", help="language code, type [ gtts-cli --all ] to see all codes")
parser.add_argument("--play", action="store_true", help="play TTS in your default MP3 player")

args = parser.parse_args()

text = "Jega Senesys"
if args.text:
    text = args.text

code = "en"
if args.lang:
    code = args.lang

filename = "output"
if args.filename:
    filename = args.filename


# SECTION TWO - RUN GOOGLE TTS / MAKE TTS FILE
##  code we added with 'pip install gTTS' ------------------------------------------------


from gtts import gTTS
tts = gTTS(args.text, lang=code)
tts.save(filename+'.mp3')



# SECTION THREE - OPEN TTS MP3 FILE IN DEFAULT PLAYER
##  will use system default program
##  plays mp3s in Groove on Windows 10, i think ------------------------------------------


import os
if args.play:
    os.system("start " + filename + ".mp3")
    
save the file and go back to Command Prompt

7. how to use the script (examples)

we're running the script in the tts-folder
bold lines can be typed into Command Prompt in the tts-folder

python tts.py --play
uses defaults for text("Jega Senesys"), language("en"), filename("output.mp3"), plays file.
python tts.py --text "today was a good day" --play
replace default text, use default language + filename, plays file
python tts.py --text "konnichiwatson" --lang ja --play
replace default text + language("ja"-Japanese), use default filename, plays file
python tts.py --text "konnichiwatson" --lang ja --filename kwatson --play
replace default text + language + filename(kwatson.mp3), plays file
python tts.py -t "konnichiwatson" -l ja -f konwatson --play
similar to above but shorter, filename(konwatson.mp3), plays file
python tts.py -t "konbanwatson" -l ja -f konbanwatson
filename(konbanwatson.mp3), DOESN'T play file
python tts.py --help
script help
gtts-cli --all
lists other language codes you may wanna try.

8. end

hopefully this was the type of thing you were looking for. o7