A basic usage of audio handling libraries for creating a fun sound-meter!
Tags: python, audio
Posted by Krish Mehta on August 4, 2016
Those who have seen the 3 blocks of audience in PCSA compete during the STAB Orientation for the loudest cheer, know what this Sound Meter is.
To analyse any incoming sound(be it mic or laptop microphone) and find its maximum volume. Actually, using other detailed operations you can estimate the frequency etc. Basically, once we read the audio input stream we can use the desired computations on it.
Plan of action
This is roughly what we need to do:
Read the input from the laptop microphone or the mic(in our case, that requires setting it to default recording device)
Find the maximum value of the sound channels over a chunk of inputs.
pyaudio for audio stream input.
audioop for max value analysis.
pygame for display.