Skip to content

Get it work with sox-stream #5

@roccomuso

Description

@roccomuso

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions