shime / play-sound

Play sounds by shelling out to one of the available audio players.
MIT License
207 stars 31 forks source link

Error: stdOut maxBuffer exceeded #12

Closed Arcnor closed 6 years ago

Arcnor commented 8 years ago

Hi,

I'm getting the error in the title when play-sound uses something like mplayer to play. The error is defined a bit here: https://github.com/robrich/gulp-exec/issues/27 (not sure if play-sound uses that module or not).

My guess is that the "progress bar" (not really, just a count of the elapsed time) that mplayer generates is filling the output buffer for the process. Using something like afplay (which doesn't output anything at all) works perfectly.

Not sure how to fix it, but if possible, piping all the output of the commands to something like /dev/null (for UNIX systems, obviously :D) should fix the issue (or adding a parameter to every supported player to work in silent mode, but I'm not sure that's possible for all of them :P)

shime commented 7 years ago

Sorry for not getting back sooner. Looks like we have to start using child_process.spawn instead of child_process.execFile.

alexbjorlig commented 6 years ago

would this be a possible work around?

const player = require('play-sound')(opts = {maxBuffer: 1024 * 1000})
shime commented 6 years ago

Closed by #22.