Skip to content

Commit

Permalink
Create voice.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushh0406 authored Feb 14, 2025
1 parent cd813a5 commit 378a018
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions voice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from gtts import gTTS
import os

# Define the text you want to convert to speech
text = "Hello! This is a sample text to convert to speech."

# Create a gTTS object
tts = gTTS(text=text, lang='en')

# Save the audio file
tts.save("output.mp3")

# Play the audio file
os.system("start output.mp3")

0 comments on commit 378a018

Please sign in to comment.