blob: a6f6809187c4be62e49aad92dc379860b67bf2e4 [file] [log] [blame]
Guido van Rossum50519c61994-10-07 10:23:49 +00001#! /usr/local/bin/python
Guido van Rossum50692d61991-09-15 21:05:15 +00002
3# radio [port]
4#
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.
7
8import sys, al
9from socket import *
10
Guido van Rossuma8413b21992-12-14 15:05:53 +000011port = 5555
Guido van Rossum50692d61991-09-15 21:05:15 +000012if sys.argv[1:]: port = eval(sys.argv[1])
13
14s = socket(AF_INET, SOCK_DGRAM)
15s.bind('', port)
16
17p = al.openport('radio', 'w')
18
19while 1:
20 data = s.recv(1400)
21 p.writesamps(data)