import socket
import ossaudiodev
dev=ossaudiodev.open("rw")
dev.setfmt(dev.getfmts())
dev.channels(2)
dev.speed(11025)
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serversocket.bind((socket.gethostname(), 5555))
serversocket.listen(5)
(clientsocket, address)=serversocket.accept()
clientsocket.send("You are connected")
while 1:
frame=dev.read(500)
clientsocket.send(frame)
dev.write(clientsocket.recv(500))
No comments:
Post a Comment