BaşlayınÜcretsiz Başlayın

Adjusting audio parameters

During your exploratory data analysis, you may find some of the parameters of your audio files differ or are incompatible with speech recognition APIs.

Don't worry, PyDub has built-in functionality which allows you to change various attributes.

For example, you can set the frame rate of your audio file calling set_frame_rate() on your AudioSegment instance and passing it an integer of the desired frame rate measured in Hertz.

In this exercise, we'll practice altering some audio attributes.

Bu egzersiz

Spoken Language Processing in Python

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import audio file
wav_file = AudioSegment.from_file(file="wav_file.wav")

# Create a new wav file with adjusted frame rate
wav_file_16k = wav_file.____(____)

# Check the frame rate of the new wav file
print(wav_file_16k.____)
Kodu Düzenle ve Çalıştır