SpeechRecognition 라이브러리 사용하기
매번 speech_recognition을 입력하지 않도록 sr로 import하겠습니다.
또한, 이후에 사용할 Recognizer 클래스의 인스턴스도 설정해 둘 거예요.
energy_threshold는 Recognizer 클래스가 오디오 파일을 얼마나 민감하게 들을지 결정하는 값으로, 0에서 4000 사이의 숫자입니다.
energy_threshold는 recognizer 클래스가 오디오를 듣는 동안 동적으로 조정됩니다.
이 연습은 강의의 일부입니다
Python으로 배우는 음성 언어 처리
연습 안내
speech_recognition라이브러리를sr로 import하세요.Recognizer클래스의 인스턴스를 생성해recognizer에 저장하세요.recognizer.energy_threshold를 300으로 설정하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Importing the speech_recognition library
import ____ as ____
# Create an instance of the Recognizer class
____ = sr.____()
# Set the energy threshold
recognizer.____ = ____