Skip to content

Instantly share code, notes, and snippets.

@pknowledge
pknowledge / text_file_to_speech.py
Created September 10, 2019 20:57
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", " ")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.