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
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