So, I had a project to work on, and my sole purpose was to record Audio using a Raspberry Pi and then encrypt it using Advance Encryption Standard.
Literally speaking, when I bought the Raspberry Pi for the first time i had no idea that there is no audio recording feature available in Raspberry Pi, I therefore, had to buy an external USB Audio card, which was capable of both Recording and Playback of audio files.
Here is the complete process to set up the environment for the first time for Audio recording,
After starting the Raspberry Pi, you are supposed to upgrade it to the latest version,
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install rpi-update
sudo rpi-update
sudo apt-get install python-dev
The reason is that, there is an issue with the Pi’s USB port that meant it could become overwhelmed with data which causes popping and bubbling noises to be included in your recordings, this can be fixed with an update of the Pi’s firmware.
The next step is to install PyAudio libraries,
$ sudo apt-get install git
$ git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
$ sudo apt-get install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev
$ sudo apt-get python-dev
$ sudo python pyaudio/setup.py install
Your device is now capable of performing both Audio Recording and Playback, the example programs are available inside PyAudio directory, You can modify the recording time and other parameters like, sampling time, buffer size from the example programs.
If you have any query than share it in the comment section below.
I shall be explaining the example programs and how to increase the recording quality in the next post.
Thank you.
Literally speaking, when I bought the Raspberry Pi for the first time i had no idea that there is no audio recording feature available in Raspberry Pi, I therefore, had to buy an external USB Audio card, which was capable of both Recording and Playback of audio files.
Here is the complete process to set up the environment for the first time for Audio recording,
After starting the Raspberry Pi, you are supposed to upgrade it to the latest version,
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install rpi-update
sudo rpi-update
sudo apt-get install python-dev
The reason is that, there is an issue with the Pi’s USB port that meant it could become overwhelmed with data which causes popping and bubbling noises to be included in your recordings, this can be fixed with an update of the Pi’s firmware.
The next step is to install PyAudio libraries,
$ sudo apt-get install git
$ git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
$ sudo apt-get install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev
$ sudo apt-get python-dev
$ sudo python pyaudio/setup.py install
Inside, PyAudio directory, there are certain example programs available to record or to play the Audio files, but at this point, you wouldn't be able to play or record anything since you haven't set your external audio card as default.
Now, Our next step is to do set our USB sound card to default.
This can be done by editing the "/etc/modprobe.d/alsa-base.conf" file, and setting the index value for usb card to 0.
The file can be edited using ed /etc/modprobe.d/alsa-base.conf
options snd-card-usb-caiaq index=0
Your device is now capable of performing both Audio Recording and Playback, the example programs are available inside PyAudio directory, You can modify the recording time and other parameters like, sampling time, buffer size from the example programs.
If you have any query than share it in the comment section below.
I shall be explaining the example programs and how to increase the recording quality in the next post.
Thank you.