radio.py
来自「reduced python source for embedded apps」· Python 代码 · 共 22 行
PY
22 行
#! /usr/bin/env 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, alfrom socket import *port = 5555if 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)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?