Don't reference removed files in Makefile
[python/dscho.git] / Demo / sgi / al / record.py
blobe5c0f5b2d8d7af649c01a9ce8eb4a5aa770997cd
1 # Record mono 16bits samples from the audio device and send them to stdout.
2 # Assume the sampling rate is compatible.
3 # Use a small queue size to minimize delays.
5 import al, sys
6 import AL
8 BUFSIZE = 2000
9 QSIZE = 4000
11 def main():
12 c = al.newconfig()
13 c.setchannels(AL.MONO)
14 c.setqueuesize(QSIZE)
15 p = al.openport('', 'r', c)
16 while 1:
17 data = p.readsamps(BUFSIZE)
18 sys.stdout.write(data)
20 try:
21 main()
22 except KeyboardInterrupt:
23 sys.exit(1)