forked from React-Group/interstellar_ai
google-help-me
This commit is contained in:
parent
24f0be8a39
commit
3588a4b703
3 changed files with 16 additions and 36 deletions
11
py/voice.py
Normal file
11
py/voice.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import speech_recognition as sr
|
||||
|
||||
|
||||
class VoiceRecognition:
|
||||
@staticmethod
|
||||
def basic_recognition(audio, option):
|
||||
r = sr.Recognizer()
|
||||
if option == "online":
|
||||
return r.recognize_google_cloud(audio)
|
||||
if option == "offline":
|
||||
return r.recognize_sphinx(audio)
|
Loading…
Add table
Add a link
Reference in a new issue