Horje
python speech to text Code Example
python text to speech
#run in Cmd or in terminal 
#pip install pyttsx3
import pyttsx3
pyttsx3.speak("hi user")
python text to speech
pip install pyttsx3
import pyttsx3
friend = pyttsx3.init()
friend.say("you are very smart")
friend.runandwait()
Source: pypi.org
text to speech python
pip install pyttsx3

import pyttsx3
engine = pyttsx3.init()
engine.say("Whetever you want the program to ray")
engine.runAndWait()
how to make text to speech in python
pip install pyttsx3
import pyttsx3 # you have to import py for python tts means text to speech and 3 for version 3 

speaker = pyttsx3.init() # congrats you have initialized a text to speech object
speaker.say('The text you want') # he will not say the word he will just store the word he have to say'
speaker.runAndWait() # this means he have to speak the text which he have stored previously
python speech to text
pip install pyttsx3
Source: pypi.org
python speech to text
import speech_recognition as sr
import pyttsx3

engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')

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")





Python

Related
sapi5 python Code Example sapi5 python Code Example
stingray Code Example stingray Code Example
check django version windows Code Example check django version windows Code Example
python discord mention user Code Example python discord mention user Code Example
merge multiple excel files with multiple worksheets into a single dataframe Code Example merge multiple excel files with multiple worksheets into a single dataframe Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7