Skip to content

Structuring your audio files (Optional)

Jyotika Singh edited this page May 20, 2022 · 1 revision

(Optional : Only required if you want to pass a dir path instead of file locations for training, classification, or feature extraction)

Training and Testing Data structuring

Let's say you have 2 classes that you have training data for (music and speech), and you want to use pyAudioProcessing to train a model using available feature options. Save each class as a directory and all the training audio .wav files under the respective class directories. Example:

.
├── training_data
├── music
│   ├── music_sample1.wav
│   ├── music_sample2.wav
│   ├── music_sample3.wav
│   ├── music_sample4.wav
├── speech
│   ├── speech_sample1.wav
│   ├── speech_sample2.wav
│   ├── speech_sample3.wav
│   ├── speech_sample4.wav

Similarly, for any test data (with known labels) you want to pass through the classifier, structure it similarly as

.
├── testing_data
├── music
│   ├── music_sample5.wav
│   ├── music_sample6.wav
├── speech
│   ├── speech_sample5.wav
│   ├── speech_sample6.wav

If you want to classify audio samples without any known labels, structure the data similarly as

.
├── data
├── unknown
│   ├── sample1.wav
│   ├── sample2.wav