I just copied and pasted this example on README
var FileWriter = require('wav').FileWriter;
var mic = require('mic'); // requires arecord or sox, see https://www.npmjs.com/package/mic
var micInstance = mic({
rate: '16000',
channels: '1',
debug: true
});
var micInputStream = micInstance.getAudioStream();
var outputFileStream = new FileWriter('./test.wav', {
sampleRate: 16000,
channels: 1
});
micInputStream.pipe(outputFileStream);
micInstance.start();
setTimeout(function() {
micInstance.stop();
}, 5000);
I have already installed both mic and wav packages from npm.I also have sox installed and it works fine.
But when I run this program I get the following error
Received Info: arecord: main:828:
Received Info: audio open error: No such file or directory
recording audioProcess has exited with code = 1
Microhphone stopped
OS : Arch Linux 4.20.11
Node version : 11.10.1
Npm version : 6.7.0
I just copied and pasted this example on README
I have already installed both mic and wav packages from npm.I also have sox installed and it works fine.
But when I run this program I get the following error
OS : Arch Linux 4.20.11
Node version : 11.10.1
Npm version : 6.7.0