1. Learn
  2. /
  3. Courses
  4. /
  5. Spoken Language Processing in Python

Exercise

Audio parameters with PyDub

Every audio file you work with will have a number of characteristics associated with them, such as, channels, frame rate (or sample rate), sample width and more.

Knowing these parameters is useful to ensure your audio files are compatible with various API requirements for speech transcription.

For example, many APIs recommend a minimum frame rate (wav_file.frame_rate) of 16,000 Hz.

When you create an instance of AudioSegment, PyDub automatically infers these parameters from your audio files and saves them as attributes.

In this exercise, we'll explore these attributes.

Instructions 1/4

undefined XP
  • 1
    • Find the frame_rate of wav_file.
  • 2
    • Find the number of channels of wav_file.
  • 3
    • Find the max amplitude of wav_file.
  • 4
    • Find the length of wav_file in milliseconds.