I'm working on creating a wav file from a stream on iheartradio. I am able to get the stream url, but once I write the data to a wav file, I cannot play it on any media player I've tried. I don't have experience with wav files too much so any help would be greatly appreciated. This is what I've got so far from looking at similar posts:
import requests
stream_url = "http://stream.revma.ihrhls.com/zc2525"
r = requests.get(stream_url, stream=True)
with open('stream.wav', 'wb') as f:
try:
for block in r.iter_content(1024):
f.write(block)
print(block)
except KeyboardInterrupt:
f.close()