Get startedGet started for free

Preparing audio files for text classification

Acme are very impressed with your work so far. So they've sent over two more folders of audio files.

One folder is called pre_purchase and contains audio snippets from customers who are pre-purchase, like pre_purchase_audio_25.mp3 (file).

And the other is called post_purchase and contains audio snippets from customers who have made a purchase (post-purchase), like post_purchase_audio_27.mp3 (file).

Upon inspecting the files you find there's about 50 in each and they're in the .mp3 format.

Acme want to know if you can build a classifier to classify future calls. You tell them you sure can.

So in this exercise, you'll go through each folder and convert the audio files to .wav format using convert_to_wav() so you can transcribe them.

This exercise is part of the course

Spoken Language Processing in Python

View Course

Exercise instructions

  • Convert the files in pre_purchase to .wav using convert_to_wav().
  • Convert the files in post_purchase to .wav using convert_to_wav().

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Convert post purchase
for file in post_purchase:
    print(f"Converting {file} to .wav...")
    convert_to_wav(____)

# Convert pre purchase
for file in ____:
    print(f"Converting {file} to .wav...")
    ____(file)
Edit and Run Code