Python Forum

Full Version: I want to know how I can determine pitch and volume from my computer microphone.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there! Firstly, I am not a Python programmer. I rarely code in Python. But now, I need to make my program runs headlessly.

I have these Java/Processing codes from https*//github*com/Notnasiul/R2D2-Processing-Pitch that takes input from computer microphone and then detect pitch and volume in real time.

http*//imgur*com/91t0zK7

As you can see here the thicker the color is the louder the volume. While, the height of the lines represent the pitch.

I manage to have this functionality using aubiopitch (check here, http*//aubio*org/manpages/latest/aubiopitch.1.html), however the process is not seamless/what I want.

1. I need to make a Python script that record sound from microphone.
2. Save that sound into .wav file.
3. Using aubiopitch my_wav_file.wav to determine the pitch and the volume in the terminal.

What I want is to just directly determine the pitch and the volume from the microphone. I do not want to save the recording to .wav file first. So my desired processes would be like this.

1. Stream audio from microphone.
2. Determine the pitch and the volume and display it into my terminal.

I hope I can get some advice on how I can get pitch and volume directly from microphone.
Thank you so much and have a good day!

EDIT 1: I cannot post links.