Working with noisy audio
In this exercise, we'll start by transcribing a clean speech sample to text and then see what happens when we add some background noise.
A clean audio sample has been imported as clean_support_call
.
We'll then do the same with the noisy audio file saved as noisy_support_call
. It has the same speech as clean_support_call
but with additional background noise.
To try and negate the background noise, we'll take advantage of Recognizer
's adjust_for_ambient_noise()
function.
This exercise is part of the course
Spoken Language Processing in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
recognizer = sr.Recognizer()
# Record the audio from the clean support call
with ____ as source:
clean_support_call_audio = ____.record(____)
# Transcribe the speech from the clean support call
text = recognizer.____(____,
language="en-US")
print(text)