changes by Barry, e.g. font lock & email addresses
[python/dscho.git] / Demo / sgi / al / radio.py
bloba6f6809187c4be62e49aad92dc379860b67bf2e4
1 #! /usr/local/bin/python
3 # radio [port]
5 # Receive audio packets broadcast by "broadcast.py" on another SGI machine.
6 # Use apanel to set the output sampling rate to match that of the broadcast.
8 import sys, al
9 from socket import *
11 port = 5555
12 if sys.argv[1:]: port = eval(sys.argv[1])
14 s = socket(AF_INET, SOCK_DGRAM)
15 s.bind('', port)
17 p = al.openport('radio', 'w')
19 while 1:
20 data = s.recv(1400)
21 p.writesamps(data)