| 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 | |