Skip to content

Commit

Permalink
Added text-to-speech functionality to generate voice from python code…
Browse files Browse the repository at this point in the history
…(Issue #2511)
  • Loading branch information
SomdattaNag committed Feb 15, 2025
1 parent cb976b0 commit 203a9b9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Python Voice Generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#install and import google text-to-speech library gtts
from gtts import gTTS
import os
#provide user input text
text=input('enter the text: ')
#covert text into voice
voice=gTTS(text=text, lang='en')
#save the generated voice
voice.save('output.mp3')
#play the file in windows
os.system('start output.mp3')

0 comments on commit 203a9b9

Please sign in to comment.