gillesdemey / node-record-lpcm16

:microphone: Records a 16-bit signed-integer linear pulse modulation code encoded audio file.
ISC License
212 stars 59 forks source link

record.start({}).on('data',function(){}) is not executing #35

Open danishnazir opened 7 years ago

danishnazir commented 7 years ago

Hi i have a script that works very fine on MacOS but when i run the same script on my vps that has ubuntu on it then the script is not executing the 'on(data)' callback it directly goes to 'on(finish)' callback i have installed the sox on the server my script is given below var file_name = Date.now(); var file = fs.createWriteStream(file_name + '.wav', { encoding: 'binary' }) record.start({ //sampleRate: 44100, //verbose: true sampleRate: 16000, compress: true, threshold: 0.5, thresholdStart: null, thresholdEnd: null, silence: '1.0', verbose: false, recordProgram: 'rec' // Defaults to 'rec' - also supports 'arecord' and 'sox' //device : null // recording device (e.g.: 'plughw:1') }).on('data',function() { console.log("writing data") }).on('end',function() { console.log("end recording ") }) .on('finish',function () {

console.log("finished") console.log(file_name) })

.pipe(file)

Can anybody HELP me in figuring out the solution to this problem? Thanks