我不确定如何从 Node 中的 wav 文件创建 blob。我就这样使用Buffer吗?...
var blippityBlob = new Buffer(filePathToWave);
最佳答案
也许你可以看看 BinaryJS
引用:
BinaryJS is a lightweight framework that utilizes websockets to send, stream, and pipe binary data bidirectionally between browser javascript and Node.js.
服务器代码
var server = BinaryServer({port: 9000});
server.on('connection', function(client){
client.on('stream', function(stream, meta){
var file = fs.createWriteStream(meta.file);
stream.pipe(file);
});
});
客户端代码
var client = BinaryClient('ws://localhost:9000');
client.on('open', function(stream){
var stream = client.createStream({file: 'hello.txt'});
stream.write('Hello');
stream.write('World!');
stream.end();
});
关于node.js - Nodejs 中的 Wav 到 Blob,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31988884/