Bootcamp / utils /audio_files.py
Vadym Myroshnyk
save
6309398
Raw
History Blame Contribute Delete
304 Bytes
import os
def get_audio_structure(audio_dir):
structure = {}
for file in sorted(os.listdir(audio_dir)):
if file.endswith(".mp3"):
label = os.path.splitext(file)[0].replace("_", " ").title()
structure[label] = [os.path.join(audio_dir, file)]
return structure