rectangletangle
rectangletangle

Reputation: 52941

What is the easiest way to access a a computers microphone in Python?

I need to get some numbers so I can generate random numbers using ambient sound.

I want something on this level pseudo code:

import microphone
p = pitch.get()
print p

Edit:

This is in Windows 7, BTW

Upvotes: 8

Views: 688

Answers (2)

luc
luc

Reputation: 43096

I don't know if it is as easy as you would like but I know that it is possible to access the microphone with tksnack. I think it is available on main platforms.

microphone access should be possible with the record method of the Sound class

I hope it helps

Upvotes: 0

Alex Martelli
Alex Martelli

Reputation: 881635

Depends on the platform. On Windows, this SO question has some answers; for Linux, try this one instead.

Upvotes: 1

Related Questions