Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing the Microphone in Python

My laptop has a microphone in it. Is there any method of obtaining numbers in Python from it? For example pitch, volume, or the duration of a noise. I'm trying to use ambient noise to create random numbers.

like image 458
rectangletangle Avatar asked Feb 23 '26 11:02

rectangletangle


1 Answers

Accessing the amplitude is easy. Depending on the plattform your app is running on you can use a framework like http://people.csail.mit.edu/hubert/pyaudio/ or http://pyalsaaudio.sourceforge.net/pyalsaaudio.html

to access the the pitch you will need a framework that performs a fft-analysis like the scipy/numpy package

like image 166
Nikolaus Gradwohl Avatar answered Feb 26 '26 00:02

Nikolaus Gradwohl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!