import pyaudio
from urllib.request import urlopen
pyaud = pyaudio.PyAudio()
srate=44100
stream = pyaud.open(format = pyaud.get_format_from_width(1),
channels = 1,
rate = srate,
output = True)
url = "www.anyurl.com"
u = urlopen(url)
data = u.read(8192)
while data:
stream.write(data)
data = u.read(8192)