We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, with this package, I can make a streaming of mp3 file with socket.io??...
Something like this using your example file
var fs = require("fs"), io = require('socket.io')(), util = require("util"), mp3Parser = require("mp3-parser"), toArrayBuffer = function (buffer) { var bufferLength = buffer.length, i = 0, uint8Array = new Uint8Array(new ArrayBuffer(bufferLength)); for (; i < bufferLength; ++i) { uint8Array[i] = buffer[i]; } return uint8Array.buffer; }; io.on('connection',function(socket){ socket.on('audio',function(data){ fs.readFile(data.pathToMp3, function (error, buffer) { if (error) { console.log("Oops: " + error); process.exit(1); } buffer = new DataView(toArrayBuffer(buffer)); var lastFrame = mp3Parser.readLastFrame(buffer), tags = mp3Parser.readTags(buffer); //how i send the chuck to the server? socket.send('chunk',tags)?? }); }); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, with this package, I can make a streaming of mp3 file with socket.io??...
Something like this using your example file
The text was updated successfully, but these errors were encountered: