node.js mp3 stream is being unexpectedly interrupted

mrcash

New Member
Here is my request handler function. It initially displays the mp3 in the browser (chrome), but only loads about half of it before crashing [error message on bottom of post].\[code\]function musicStream(response){ song_name = 'test.mp3'; console.log("Request handler 'musicStream' was called"); var filePath = path.join(__dirname, song_name); var stat = fs.statSync(filePath); response.writeHead(200, { 'Content-Type': 'audio/mpeg', 'Transfer-Encoding': 'chunked', 'Content-Length': stat.size }); var readStream = fs.createReadStream(filePath); readStream.on('data', function(data) { response.write(data); }); readStream.on('end', function() { response.end(); }); } \[/code\]Here are some console messages for more info:\[code\]Request handler 'musicStream' was callednode: src/uv-common.c:98: uv_err_name: Assertion `0' failed.Aborted\[/code\]Thank you!
 
Top