PyAudio seems to be what you are looking for. It is a python module that allows you to reproduce and record streamed audio files. It also allows you implement the server.
According PyAudio's site: Runs in GNU/Linux, Microsoft Windows, and Apple Mac OS X.
This is an example I copy from http://people.csail.mit.edu/hubert/pyaudio/#examples :
"""PyAudio Example: Play a WAVE file."""
import pyaudio
import wave
import sys
CHUNK = 1024
if len(sys.argv) < 2:
print("Plays a wave file.\n\nUsage: %s filename.wav" % sys.argv[0])
sys.exit(-1)
wf = wave.open(sys.argv[1], 'rb')
p = pyaudio.PyAudio()
stream = p.open(format=p.get_format_from_width(wf.getsampwidth()),
channels=wf.getnchannels(),
rate=wf.getframerate(),
output=True)
data = wf.readframes(CHUNK)
while data != '':
stream.write(data)
data = wf.readframes(CHUNK)
stream.stop_stream()
stream.close()
p.terminate()
I think you will find this interesting too. And surely brings you some ideas.