Skip to content

About

Node.JS Microphone Recorder package

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Microphone Recorder NodeJS Addon

(for Windows only)

Written using VC++ and N-API

Uses ffmpeg.exe internally (embedded in package) Partially uses Windows waveIn...() API to get device names

EXAMPLE USAGE

Check example.js to see the usage node example.js

const microphoneAddon = require('./index.js');

console.log('Listing the devices:');
console.log(microphoneAddon.listRecordingDevices());


console.log('Start recording...');
const fullPathName = 'c://test.mp3';  // use .m4a extension for aac codec
const inputDeviceIndex = 0; // Record from the first device  (0 is default audio input device)
const codec = 'libmp3lame';  // aac, ac3, flac, opus, libmp3lame, wavpack    https://www.ffmpeg.org/ffmpeg-codecs.html
microphoneAddon.startRecording(fullPathName, inputDeviceIndex, codec);



console.log('Waiting for 5 sec to have something recorded...');
function stopfunc() {
	console.log('Stop recording...');
	microphoneAddon.stopRecording();
}
setTimeout(stopfunc, 5000);  // stop recording after 5 seconds

Exported functions

function listRecordingDevices() 

function startRecording(fullPathName, inputDeviceIndex, codec)

function stopRecording()

BUILD STEPS

npm run build 
  • If it fails, please run the following commands (in project directory)
npm install node-gyp --save-dev
npm install node-addon-api

Notes:

The development platform I used:

  • Node v12.15.0
  • Visual Studio 2019 v16.4.4
  • Windows Server 2019 (Version 1809)

About

Node.JS Microphone Recorder package

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages