TooTallNate/node-lame

I use .pipe(new lame.Decoder), but not work

Closed this issue · 3 comments

let mp3Stream  = fs.createReadStream(`./${req.file.path}`)

    mp3Stream
      .pipe(new lame.Decoder)
      .pipe(fs.createWriteStream(path.resolve(__dirname, './sample_pcm.pcm')))

the sample_pcm.pcm is empty file

I would recommend adding error handlers so that you can see what goes wrong, e.g. with the pump utility: https://github.com/mafintosh/pump

const mp3Stream  = fs.createReadStream(`./${req.file.path}`)
const decoder = new lame.Decoder()
const output = fs.createWriteStream(path.resolve(__dirname, './sample_pcm.pcm'))

pump(mp3Stream, decoder, output, (err) => {
  console.error(err.stack)
})

I use pump, but it has no err throw, is undefined..., but pcm file is also empty

I think my mp3 file has some problem