File tree 1 file changed +13
-5
lines changed
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 28
28
from playsound import * # for sound output
29
29
30
30
# 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..
35
44
36
45
# importing the pyttsx3 library
37
- import pyttsx3
38
46
import webbrowser
39
47
import smtplib
40
48
You can’t perform that action at this time.
0 commit comments