Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danishnazir opened this issue May 14, 2017 · 0 comments
Open

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

danishnazir opened this issue May 14, 2017 · 0 comments
Labels

Comments

@danishnazir
Copy link

danishnazir commented May 14, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants