File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 2828from playsound import * # for sound output
2929
3030# master
31- import speech_recognition as sr # speech_recognition Library for performing speech recognition with support for Google Speech Recognition, etc..
32-
33- # pip install pyttsx3
34- # need to run only once to install the library
31+ # auto install for pyttsx3 and speechRecognition
32+ import os
33+ try :
34+ import pyttsx3 #Check if already installed
35+ except :# If not installed give exception
36+ os .system ('pip install pyttsx3' )#install at run time
37+ import pyttsx3 #import again for speak function
38+
39+ try :
40+ import speech_recognition as sr
41+ except :
42+ os .system ('pip install speechRecognition' )
43+ import speech_recognition as sr # speech_recognition Library for performing speech recognition with support for Google Speech Recognition, etc..
3544
3645# importing the pyttsx3 library
37- import pyttsx3
3846import webbrowser
3947import smtplib
4048
You can’t perform that action at this time.
0 commit comments