We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to transfrom wav to mp3 ,but i got an error Error: output buffer too small
Error: output buffer too small
let lame = require('lame') const wav = require('wav') const fs = require('fs') function wav2mp3(input, output, next = function() {}) { const rs = fs.createReadStream(input) const ws = fs.createWriteStream(output) const reader = new wav.Reader() // the "format" event gets emitted at the end of the WAVE header reader.on('format', function(format) { const encoder = new lame.Encoder({ // input channels: format.channels, // 2 channels (left and right) bitDepth: format.bitDepth, // 16-bit samples sampleRate: format.sampleRate, // 44,100 Hz sample rate // output bitRate: 128, outSampleRate: 22050, mode: lame.STEREO // STEREO (default), JOINTSTEREO, DUALCHANNEL or MONO }) // the WAVE header is stripped from the output of the reader reader.pipe(encoder) encoder.pipe(ws) }) // pipe the WAVE file to the Reader instance reader.on('finish', () => { rs.close() ws.close() next(null); }) rs.pipe(reader) } wav2mp3('./xxx.wav', './xxx.mp3', (err) => { console.log('success') })
xxx.zip
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to transfrom wav to mp3 ,but i got an error
Error: output buffer too small
files
xxx.zip
The text was updated successfully, but these errors were encountered: