How it works...
In Step 1, we prepared a dataset for the generator. We created a DataFrame that contains the file path and the class label of the audio file. In the next step, we created stratified samples and split the DataFrame into train, test, and validation sets. In Step 3, we created our convolutional neural network and compiled it.
In Step 4, we built a data generator and created training and validation generators. The generator function reads the audio files from disk, transforms each signal into its frequency-amplitude representation, and outputs the data in batches. We know that the speech commands dataset is sampled at 16 kHz; that is, for a 1-second recording, there are 16,000 samples. The dataset also contains a few audio files ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access