This code can read a string and extract an output with vocal . The code run without problem.The only problem that i face is that i want to run the .py file everytime that i turn on my pc. I put also the .py file in the Startup Folder but nothing happened . This is my code:
from plyer import notification
import getpass
import os
import speech_recognition as sr
import playsound
from gtts import gTTS
USER_NAME = getpass.getuser()
notification.notify(
# title of the notification,
# the body of the notification
message="Welcome",
# the notification stays for 50sec
timeout=0.5,
)
def speak(text):
tts = gTTS(text=text, lang="en")
filename = "voice.mp3"
tts.save(filename)
playsound.playsound(filename)
speak("Welcome Michael")