“teks pidato” Kode Jawaban

teks pidato

# Import the required module for text
# to speech conversion
from gtts import gTTS

# This module is imported so that we can
# play the converted audio

mytext = input("Enter the text to be converted: ")

language = 'en'



myobj = gTTS(text=mytext, lang=language, slow=False)

E = input("Enter the name of the file: ")

myobj.save(E + ".mp3")
#you can change mp3 to wav
cool dude

Pidato untuk SMS

import speech_recognition as sr
import pyttsx3

engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
# print(voices[1].id)
engine.setProperty('voice', voices[0].id)


def speak(audio):
    engine.say(audio)
    engine.runAndWait()

r = sr.Recognizer()

with sr.Microphone() as source:
    print("Speak anything")
    speak("Speak anything")
    audio = r.listen(source)

try:
    text = r.recognize_google(audio)
    print("you said : {}".format(text))
    speak("you said : {}".format(text))

except:
 print("Sorry could not recognize your voice")
 speak("Sorry could not recognize your voice")
Coding boy Hasya

Pidato untuk SMS

<html>

</html>
Adventa Project

Jawaban yang mirip dengan “teks pidato”

Pertanyaan yang mirip dengan “teks pidato”

Lebih banyak jawaban terkait untuk “teks pidato” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya