We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1aab213 commit 511f98aCopy full SHA for 511f98a
test/voice_detect_test.py
@@ -0,0 +1,12 @@
1
+import speech_recognition as sr
2
+language = 'zh-TW'
3
+# default is english
4
+r = sr.Recognizer()
5
+with sr.WavFile("test.wav") as source:
6
+ # load wav
7
+ audio = r.record(source)
8
+try:
9
+ # using google service
10
+ print("Transcription: " + r.recognize_google(audio,language=language))
11
+except:
12
+ print("Could not understand audio")
0 commit comments