📘 Lesson  ·  Lesson 96

Text to Speech

इस Project के बारे में

💡 एक नज़र में

Python text को बोली में बदल सकता है pyttsx3 (offline) या gTTS (Google, online) जैसी libraries से।

pyttsx3 (offline)

Python
import pyttsx3
engine = pyttsx3.init()
engine.say("Hello, welcome to CodingEasily")
engine.runAndWait()

gTTS (MP3 save करता है)

Python
from gtts import gTTS
tts = gTTS("Hello from CodingEasily")
tts.save("hello.mp3")
print("Audio saved as hello.mp3")
Audio saved as hello.mp3

सारांश

  • pyttsx3 offline text बोलता है; gTTS Google से MP3 बनाता है।
  • pip install pyttsx3 gTTS से install करें।
← Back to Python Tutorial
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

💻 लाइव कोड एडिटर

इस पेज के प्रोग्राम यहीं तैयार हैं — चलाएँ, बदलें और सीखें। कुछ भी इंस्टॉल किए बिना।
OneCompiler द्वारा संचालित। कोड एडिटर में अपने आप आ जाता है — Run दबाकर आउटपुट देखें। अगर एडिटर न खुले तो नए टैब में खोलें.