Skip to content
New issue

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

Get it work with sox-stream #5

Open
roccomuso opened this issue Oct 9, 2017 · 2 comments
Open

Get it work with sox-stream #5

roccomuso opened this issue Oct 9, 2017 · 2 comments

Comments

@roccomuso
Copy link
Contributor

roccomuso commented Oct 9, 2017

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

Changing the input channel i have this error on sox instead:

Error: sox WARN formats: can't set 1 channels; using 2

@jb55
Copy link
Contributor

jb55 commented Oct 11, 2017 via email

@roccomuso
Copy link
Contributor Author

what do you mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants