Exercise

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.

Instructions 1/3

undefined XP
  • 1
    • Create a new wav_file with a frame rate of 16,000 Hz and then check its frame rate.
  • 2
    • Set the wav_file number of channels to 1 and then check the number of channels.
  • 3
    • Print the sample width of wav_file and then set it to 1 and print it again.