Datasets:
# Print the number of audio files in each directory | |
import os | |
for dir in os.listdir("."): | |
if not dir.startswith(".") and os.path.isdir(dir): # Ignore hidden dirs and files | |
files = os.listdir(dir) | |
mp3_files = [f for f in files if f.endswith(".mp3")] # Only list mp3 files | |
wav_files = [f for f in files if f.endswith(".wav")] # Only list mp3 files | |
print(f"{dir}: {len(mp3_files) + len(wav_files)}") | |