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.
Deze oefening maakt deel uit van de cursus
Spoken Language Processing in Python
Oefeninstructies
- Convert the files in
pre_purchaseto.wavusingconvert_to_wav(). - Convert the files in
post_purchaseto.wavusingconvert_to_wav().
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# 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)