Datasets:
script to print stats
Browse files- print_stats.py +12 -0
print_stats.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Print the number of audio files in each directory
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
|
| 5 |
+
for dir in os.listdir("."):
|
| 6 |
+
|
| 7 |
+
if not dir.startswith(".") and os.path.isdir(dir): # Ignore hidden dirs and files
|
| 8 |
+
files = os.listdir(dir)
|
| 9 |
+
mp3_files = [f for f in files if f.endswith(".mp3")] # Only list mp3 files
|
| 10 |
+
wav_files = [f for f in files if f.endswith(".wav")] # Only list mp3 files
|
| 11 |
+
|
| 12 |
+
print(f"{dir}: {len(mp3_files) + len(wav_files)}")
|