Skip to content

Commit

Permalink
Merge pull request #2525 from SomdattaNag/add-text-to-speech
Browse files Browse the repository at this point in the history
Added text-to-speech functionality to generate voice from python code for Issue #2511.
  • Loading branch information
geekcomputers authored Feb 16, 2025
2 parents cb976b0 + 203a9b9 commit 716b158
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 716b158

Please sign in to comment.