Skip to content

sox-stream does not work with file descriptor #20

@prostosergey

Description

@prostosergey

I'm trying to pass the 'raw' audio-stream from fd: to nodejs sox-stream, but transcode result are always empty, without any warn/errors messages ((

stream = fs.createReadStream(null, {fd: 3, autoClose: false }); 
var transcode = sox({
     global:  { guard: true,  'no-dither': true, norm: true, temp: '/tmpfs' },
     input:   { type: 'raw', 'ignore-length': true, encoding: 'signed-integer', bits: 16, rate: 8000, channels: 1 },
     output:  { type: 'raw' },
});
var dest  = fs.createWriteStream('/tmpfs/song.raw');
stream.pipe(transcode).pipe(dest);

But if I divide into 2 operations, all is well:

// 1 - 'from fd: to file'

stream.pipe(dest);

// 2 - 'from file to transcode'


 var src  = fs.createReadStream('/tmpfs/song.raw'); 
           src.pipe( transcode ).pipe(dest2);

Why sox-stream doesn't work with file descriptor (only with file) ? How to make it work? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions