This article explains about audio data analysis with python. The activity below gives a clear idea on reading audio files , plotting them & editing them adding convolutions.
We shall learn all these by creating a basic audio editor which helps introduce echos and modulations in an audio file and save them to your system.
What is audio ?
Audio has always been a 1-dimensional signal used to describe any noise or sound that is within a range of human ears to hear.
Basic unit of audio measurement is hertz.
Few of famous audio formats include MP3 , WAV , MPEG etc.
Why do we need audio analysis?
With huge buzz on natural language processing & audio analysis this field includes digital signal processing, automatic speech recognition, music generation and classification , audio analysis is gaining huge attention.
The audio data analysis is all about analysing and understanding audio signals or voice/noise/music data.
Few of real word applications of audio analysis include alexa , echo etc.
How can we do audio analytics?
In simple terms , every audio wave has a frequency. Every frequency has a value.We humans can hear sound between 20 Hz (lowest pitch) to 20 kHz (highest pitch).
Python Modules like audio2numpy , scipy directly ouputs the audio data as a numpy array and its sampling rate. In the activity below we demo how can we modify audio files and get a feel on how audio processing / analytics can be done.
In short , we are playing with sampling rate & checking out how it effects the audio file.
Python Version | Difficulty Level | Pre-Requisites |
2.7+ | Easy | Basic Python |
Download the input file from THIS LINK.
We are adding another convolution to the audio. This is like adding another audio dimension which creates echo & sound effects !
This creates an audio file in your system ! Just listen the echo 🙂
We can slice, add , cut , edit any part of audio based on signal index (here it is 48000 i.e sampling rate)
write(‘modified_audio2.wav’, 48000, modified_audio)
This creates an audio file in your system ! Just listen the edits 🙂