diff options
Diffstat (limited to 'Demo/sgi/al/radio.py')
-rwxr-xr-x | Demo/sgi/al/radio.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Demo/sgi/al/radio.py b/Demo/sgi/al/radio.py new file mode 100755 index 0000000..1b72369 --- /dev/null +++ b/Demo/sgi/al/radio.py @@ -0,0 +1,21 @@ +#! /ufs/guido/bin/sgi/python + +# radio [port] +# +# Receive audio packets broadcast by "broadcast.py" on another SGI machine. +# Use apanel to set the output sampling rate to match that of the broadcast. + +import sys, al +from socket import * + +port = 54321 +if sys.argv[1:]: port = eval(sys.argv[1]) + +s = socket(AF_INET, SOCK_DGRAM) +s.bind('', port) + +p = al.openport('radio', 'w') + +while 1: + data = s.recv(1400) + p.writesamps(data) |