Skip to content

Commit

Permalink
Listen for ffmpeg 'close' event instead of 'exit'. (#73)
Browse files Browse the repository at this point in the history
Allows the ffmpeg process stdout stream (ie. the piped sample) to be fully processed always even if the system is under heavy load.
  • Loading branch information
qtiki authored and SargoDarya committed Feb 27, 2018
1 parent fc7c5b1 commit ecb1634
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion audiosprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module.exports = function(files) {
let ffmpeg = spawn('ffmpeg', ['-i', path.resolve(src)]
.concat(wavArgs).concat('pipe:'))
ffmpeg.stdout.pipe(fs.createWriteStream(dest, {flags: 'w'}))
ffmpeg.on('exit', function(code, signal) {
ffmpeg.on('close', function(code, signal) {
if (code) {
return cb({
msg: 'File could not be added',
Expand Down

0 comments on commit ecb1634

Please sign in to comment.