Closed swordsreversed closed 7 years ago
Don't do the lame.Decoder()
part on the server side. You want to send the MP3 data to the client, not the raw PCM bytes.
Also you're shadowing the res
variable from the HTTP request so you're actually trying to write to the icy socket. Use a different variable name for one or the other.
Also you can just do icyStream.pipe(httpRes)
(assuming you changed to those variable names) to avoid all the on('data')
stuff.
Hope that helps!
Anyone able to give an example to send audio to an html audio tag, or point out what i'm doing wrong? I tried the example to Speaker and it works fine. Adapting that to do
with the same input stream and lame quits, complaining about illegal headers.
Html is