Processing unstructured audio
You have a lot of .wav
files to process, which could take a long time. Fortunately, the functions you just wrote can be used with Dask bags to run the analysis in parallel using all your available cores.
Here are descriptions of the not_silent()
function you wrote, plus two extras you can use.
not_silent(audio_dict)
- Takes an audio dictionary, and checks if the audio isn't silent. Returns True/False.peak_frequency(audio_dict)
- Takes a dictionary of audio data, analyzes it to find the peak frequency of the audio, and adds it to the dictionary.delete_dictionary_entry(dict, key_to_drop)
- Deletes a given key from the input dictionary.
The audio data loaded_audio_bag
is available in your environment.
This exercise is part of the course
Parallel Programming with Dask in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Filter out blank audio files
filtered_audio_bag = loaded_audio_bag.____(____)