Skip to content

audio open error: No such file or directory when writing stream from mic to a file #28

Description

@BeaRRRRR

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions