Recording audio samples with the Raspberry Pi Pico
Like any ML project, we need to prepare a dataset. For our purposes, the audio clips will be acquired with the microphone connected to the microcontroller. This choice will help us obtain an ML model with high accuracy because the samples derive from the exact microphone used in the final application.
In this recipe, we will create an Arduino sketch to record audio clips of 4 seconds with the Raspberry Pi Pico. The audio samples will then be transmitted over the serial connection and transformed into audio files in the following recipe.
Getting ready
Microcontrollers can be employed to build fully functional digital audio recorders when paired with a microphone.
To accomplish this task with our microphone, we must develop a program to sample the audio analog signal at regular intervals, also known as the sample rate.
To create the correct digital representation, we must consider the following:
- The sample...