Skip to content

Commit

Permalink
Create text to speech
Browse files Browse the repository at this point in the history
So, in this way, you can very easily make a text to speech conversion using Python. The file will be saved in the same folder where you are executing this python code (the current working folder).
You can make this better in many ways like you can extract text from a pdf and then convert it to speech for reading out a pdf completely. You can also extract text from images and then do the same stuff.
  • Loading branch information
akhilesh147 authored Oct 19, 2020
1 parent 8682a38 commit 307cdb5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions text to speech
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pip install gTTS
#importing the gTTS library
from gtts import gTTS
#Asking the user for the required text
mt = input("Enter the required text:\t")
#Setting the output language
language = ‘en’
#Converting text to speech and choosing speed as fast
voice = gTTS(text=mt, lang=language, slow=False)
#Saving the speech as mp3 file
voice.save(“conv.mp3”)

0 comments on commit 307cdb5

Please sign in to comment.