Skip to content

Instantly share code, notes, and snippets.

@DuncanWilliamGibbons
DuncanWilliamGibbons / text_file_to_speech.py
Created August 31, 2020 13:49 — forked from pknowledge/text_file_to_speech.py
TEXT TO SPEECH IN PYTHON | Convert Text to Speech in Python
# Import the Gtts module for text
# to speech conversion
from gtts import gTTS
# import Os module to start the audio file
import os
fh = open("test.txt", "r")
myText = fh.read().replace("\n", " ")