Closed iocmet closed 1 year ago
+1
what
Any one solve this ?
Hello, hope this helps someone since I spent a lot of time debugging.
ffmpeg({ stdoutLines: 0 })
.input( readableStream )
.inputFormat('g729')
.audioCodec('pcm_s16le')
.format('s16le')
.stream()
.on('error', (err) => {
console.log('Error decoding G.729 payload:');
console.log(err);
callback(err);
})
.on('data', (chnk) => {
// Append the chunk
decodedAudio = Buffer.concat([decodedAudio, chnk]);
})
.on('end', () => {
// Need to wait a bit here to allow the stream to finish correctly
setTimeout(() => { callback(null, decodedAudio); }, 10);
});
Before I added the setTimeout I was getting the "Output stream closed" error, and now its gone.
Thanks, i currently not have this part of code in my app but i will close issue