title: play raw audio file in python in realtime
body: <p>I have a <code>udp</code> server in python that continuously receives voice packets from a client in raw format, array of bytes. How can I play the voice on the server side in real time? Any recommended libraries or ways to do it?  </p>
  
  <p>Here is my very simple server code if needed (which I doubt)</p>
  
  <pre><code>import socket
  
  UDP_IP = "192.168.1.105"
  UDP_PORT = 5005
  
  sock = socket.socket(socket.AF_INET, # Internet
                       socket.SOCK_DGRAM) # UDP
  sock.bind((UDP_IP, UDP_PORT))
  
  while True:
      data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes
      #what to do to stream the incoming voice packets?
  </code></pre>