8

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

rectangletangle
  • 50,393
  • 94
  • 205
  • 275
  • Using ambient sound will not be very random at all. Unless your microphone can listen to atom-level harmonic vibrations. – Borealid Jul 10 '10 at 04:57
  • possible duplicate of [Microphone access in Python](http://stackoverflow.com/questions/193789/microphone-access-in-python) – zaf Jul 10 '10 at 05:17

2 Answers2

1

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

Community
  • 1
  • 1
Alex Martelli
  • 854,459
  • 170
  • 1,222
  • 1,395
0

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

luc
  • 41,928
  • 25
  • 127
  • 172