python speech recognition UnknownValueError?

code:

import os 

import speech_recognition as sr

r = sr.Recognizer()

m = sr.Microphone(device_index=2)

try:

    print("wait a moment...")

    with m as source: r.adjust_for_ambient_noise(source)

    print("set min energy threshold to {}".format(r.energy_threshold))

    while True:

        print("say more...")

        with m as source: audio = r.listen(source)

        print("get audio to stt...")

        try:

            txt = r.recognize_google(audio)

            if str is bytes:  

                print(u"You: {}".format(txt).encode("utf-8"))

            else:  

                print("You: {}".format(txt))

            tt=str(txt)

            if txt =="turn off":

                print("t.f")

                os.system('python /home/pi/Desktop/gpio1d.py')

            elif txt =="turn on":

                print("t.n")

                os.system('python /home/pi/Desktop/gpio1.py')

        except sr.UnknownValueError:

            print("ERROR")

        except sr.RequestError as e:

            print("ERROR has Couldn't request results from Google Speech Recognition service; {0}".format(e))

        

except KeyboardInterrupt:

    pass

我不管講中文英文它都是UnknownValueError環境也很安靜

尚未解答。
成為第一個解答此問題的人。