ComenzarEmpieza gratis

Using the SpeechRecognition library

To save typing speech_recognition every time, we'll import it as sr.

We'll also setup an instance of the Recognizer class to use later.

The energy_threshold is a number between 0 and 4000 for how much the Recognizer class should listen to an audio file.

energy_threshold will dynamically adjust whilst the recognizer class listens to audio.

Este ejercicio forma parte del curso

Spoken Language Processing in Python

Ver curso

Instrucciones del ejercicio

  • Import the speech_recognition library as sr.
  • Setup an instance of the Recognizer class and save it to recognizer.
  • Set the recognizer.energy_threshold to 300.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Importing the speech_recognition library
import ____ as ____

# Create an instance of the Recognizer class
____ = sr.____()

# Set the energy threshold
recognizer.____ = ____
Editar y ejecutar código