Giúp mình tắt phần except

import speech_recognition as sr

# initialize the recognizer

r = sr.Recognizer()

with sr.Microphone() as source:

    # read the audio data from the default microphone

    audio_data = r.record(source,duration=5)

    print("Recognizing...")

    # convert speech to text

    try:

        text = r.recognize_google(audio_data, language="vi")

    except:

        text = ""

    print(text)

nó cứ chạy nó miết vì không tắt được except
vì vậy mình nói gì thì nó không hiện ra và không chuyển âm thành văn bản
mọi người giúp mình thêm code bớt code giúp mình mình cảm ơn

Trùng

A post was moved

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?