LoslegenKostenlos loslegen

An audio processing workflow

You've seen how to import and manipulate a single audio file using PyDub. But what if you had a folder with multiple audio files you needed to convert?

In this exercise we'll use PyDub to format a folder of files to be ready to use with speech_recognition.

You've found your customer call files all have 3-seconds of static at the start and are quieter than they could be.

To fix this, we'll use PyDub to cut the static, increase the sound level and convert them to the .wav extension.

You can listen to an unformatted example here.

Diese Übung ist Teil des Kurses

Spoken Language Processing in Python

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

file_with_static = AudioSegment.from_file(____)

# Cut the first 3-seconds of static off
file_without_static = file_with_static[____:]
Code bearbeiten und ausführen