Open roccomuso opened 7 years ago
It would be cool if we find a way to make it work with sox-stream. Any hint?
I wasn't able to get it working using this code:
var createBpmSink = require('../') var sox = require('sox-stream') var fs = require('fs') var src = fs.createReadStream('hellberg.mp3') var transcode = sox({ input: { type: 'mp3', encoding: 'float', rate: 44100, channels: 2 }, output: { type: 'mp3' } }) var bpmSink = createBpmSink() src.pipe(transcode).pipe(bpmSink) bpmSink.on("bpm", function(bpm){ console.log(Math.floor(bpm)) createBpmSink() });
I got an issue: RangeError: Index out of range
RangeError: Index out of range
Changing the input channel i have this error on sox instead:
Error: sox WARN formats: can't set 1 channels; using 2
The only thing I can think of is attaching to the on('data') event and making sure that the data coming out of that library is the same as the original example.
what do you mean?
It would be cool if we find a way to make it work with sox-stream. Any hint?
I wasn't able to get it working using this code:
I got an issue:
RangeError: Index out of range
Changing the input channel i have this error on sox instead:
Error: sox WARN formats: can't set 1 channels; using 2