{"_id":"@analyticsinmotion/micstream","_rev":"7-0f20a9cf242a5a63b97048827cf707de","name":"@analyticsinmotion/micstream","dist-tags":{"latest":"0.4.0"},"versions":{"0.0.1":{"name":"@analyticsinmotion/micstream","version":"0.0.1","license":"MIT","_id":"@analyticsinmotion/micstream@0.0.1","maintainers":[{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"}],"homepage":"https://github.com/analyticsinmotion/micstream#readme","bugs":{"url":"https://github.com/analyticsinmotion/micstream/issues"},"dist":{"shasum":"ecaee0fbafc73ecbdd750e39e9763e035b6a0a91","tarball":"https://registry.npmjs.org/@analyticsinmotion/micstream/-/micstream-0.0.1.tgz","fileCount":2,"integrity":"sha512-MQw0HktwqtJCFJkePGPLXThWd6ZYGdhSOjjxlYb8K0iH1v2o7yMHxglHPessfpKo1Akp0UKkCWfaxTEuL7KnOA==","signatures":[{"sig":"MEYCIQCSxLrjBJTKUSbwRStbXE9XfJ4zuoJQos+aD9heyL/IXgIhAOZU7t2Zl2RFeey2xFwfhwlYx4/D0oucBcod4RUIt9Rv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":421},"main":"index.js","_npmUser":{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"},"repository":{"url":"git+https://github.com/analyticsinmotion/micstream.git","type":"git"},"_npmVersion":"10.9.3","description":"Cross-platform microphone audio capture for Node.js with pre-built binaries. No build tools required.","directories":{},"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/micstream_0.0.1_1772981340223_0.2313734597471957","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package has been renamed to decibri. Install it with: npm install decibri"},"0.0.2":{"name":"@analyticsinmotion/micstream","version":"0.0.2","license":"Apache-2.0","_id":"@analyticsinmotion/micstream@0.0.2","maintainers":[{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"}],"homepage":"https://github.com/analyticsinmotion/micstream#readme","bugs":{"url":"https://github.com/analyticsinmotion/micstream/issues"},"dist":{"shasum":"0ab53f07c0b14c8d7ac253426d560bec4e4a596d","tarball":"https://registry.npmjs.org/@analyticsinmotion/micstream/-/micstream-0.0.2.tgz","fileCount":3,"integrity":"sha512-ECG1W61Fnhusbmu1Ft4Zu1roS+4rctL8J+hHwDiowjue3nVPIhDeWggzsMA1uYOMHAGp3Bfjf1ESus+2bAbPbA==","signatures":[{"sig":"MEUCIQDSA1sRX8ycoevebFVUXcJSJ3cQZKruxcLfJZVMj7Sj5gIgMABaDwIHWx5MLPVTo2g9aGeo/miGITiebUUld/Vgpps=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11207},"main":"index.js","_npmUser":{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"},"repository":{"url":"git+https://github.com/analyticsinmotion/micstream.git","type":"git"},"_npmVersion":"10.9.3","description":"Cross-platform microphone audio capture for Node.js with pre-built binaries. No build tools required.","directories":{},"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/micstream_0.0.2_1772982518946_0.6332595631204527","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package has been renamed to decibri. Install it with: npm install decibri"},"0.1.0":{"name":"@analyticsinmotion/micstream","version":"0.1.0","keywords":["microphone","audio","capture","stream","pcm","portaudio","native","prebuilt"],"license":"Apache-2.0","_id":"@analyticsinmotion/micstream@0.1.0","maintainers":[{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"}],"homepage":"https://github.com/analyticsinmotion/micstream#readme","bugs":{"url":"https://github.com/analyticsinmotion/micstream/issues"},"os":["win32","darwin","linux"],"cpu":["x64","arm64"],"dist":{"shasum":"bc84534a1b3ac6225e14e64be40b07e3432e1e70","tarball":"https://registry.npmjs.org/@analyticsinmotion/micstream/-/micstream-0.1.0.tgz","fileCount":347,"integrity":"sha512-7X9DOT8HP/7sMh4NNyMbn18MxdCWZr4NRGspFAlESEVSdKlJ9wUaAKZc47euHXM3cFBG/6dVAY7vhusKXqCCZw==","signatures":[{"sig":"MEQCIEdvJ8GtKefZM3B5gICHYfxnc9Ha48SH8hD5viI6jD52AiBF5Eia4HDssQ3s0t7nf7Fu8E9KnfESLGGlyhFDm3hixg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7436414},"main":"index.js","binary":{"napi_versions":[6]},"engines":{"node":">=16.0.0"},"gitHead":"a4a23a6decafcff4439250026235a7714d944517","scripts":{"test":"node test/basic.js","build":"node-gyp rebuild","install":"prebuild-install --runtime napi || node-gyp rebuild","prebuild:all":"prebuild --runtime napi --target 6 --strip"},"_npmUser":{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"},"repository":{"url":"git+https://github.com/analyticsinmotion/micstream.git","type":"git"},"_npmVersion":"10.9.3","description":"Cross-platform microphone audio capture for Node.js with pre-built binaries. No build tools required.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"node-gyp-build":"^4.6.0","prebuild-install":"^7.1.1"},"_hasShrinkwrap":false,"devDependencies":{"node-gyp":"^10.0.0","prebuild":"^13.0.0","node-addon-api":"^7.0.0"},"prebuild-install":{"target":"6","runtime":"napi"},"_npmOperationalInternal":{"tmp":"tmp/micstream_0.1.0_1773045124048_0.542931915875851","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package has been renamed to decibri. Install it with: npm install decibri"},"0.2.0":{"name":"@analyticsinmotion/micstream","version":"0.2.0","keywords":["microphone","audio","capture","stream","pcm","portaudio","native","prebuilt"],"license":"Apache-2.0","_id":"@analyticsinmotion/micstream@0.2.0","maintainers":[{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"}],"homepage":"https://github.com/analyticsinmotion/micstream#readme","bugs":{"url":"https://github.com/analyticsinmotion/micstream/issues"},"os":["win32","darwin","linux"],"cpu":["x64","arm64"],"dist":{"shasum":"805356f88c9b6d607dc46f96c78384a197a2f286","tarball":"https://registry.npmjs.org/@analyticsinmotion/micstream/-/micstream-0.2.0.tgz","fileCount":349,"integrity":"sha512-RDbk2sd0BuVImoCxLV+OAHmE59RRplhGJR6RJJ5N9qkObyqSPRltmHL4ZLxx2tu+WqPvbqsfTT0Ox+6Glf8O1Q==","signatures":[{"sig":"MEYCIQD745YMX/4e+yV2VLv4QTABzA0nruqJkGK2AHAib4YELgIhAO0qAyejYqdjzV9qu9/Yj5XKtnRik8IJy4Ci6ZclLOd6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7451789},"main":"index.js","types":"types/index.d.ts","binary":{"napi_versions":[6]},"engines":{"node":">=16.0.0"},"gitHead":"0883bf85af9146f1719b87afa833ac948863674d","scripts":{"test":"node test/basic.js","build":"node-gyp rebuild","install":"prebuild-install --runtime napi || node-gyp rebuild","prebuild:all":"prebuild --runtime napi --target 6 --strip"},"_npmUser":{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"},"repository":{"url":"git+https://github.com/analyticsinmotion/micstream.git","type":"git"},"_npmVersion":"10.9.3","description":"Cross-platform microphone audio capture for Node.js with pre-built binaries. No build tools required.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"node-gyp-build":"^4.6.0","prebuild-install":"^7.1.1"},"_hasShrinkwrap":false,"devDependencies":{"node-gyp":"^10.0.0","prebuild":"^13.0.0","node-addon-api":"^7.0.0"},"prebuild-install":{"target":"6","runtime":"napi"},"_npmOperationalInternal":{"tmp":"tmp/micstream_0.2.0_1773062306047_0.5049726867393038","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package has been renamed to decibri. Install it with: npm install decibri"},"0.3.0":{"name":"@analyticsinmotion/micstream","version":"0.3.0","keywords":["microphone","audio","capture","stream","pcm","portaudio","native","prebuilt"],"license":"Apache-2.0","_id":"@analyticsinmotion/micstream@0.3.0","maintainers":[{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"}],"homepage":"https://github.com/analyticsinmotion/micstream#readme","bugs":{"url":"https://github.com/analyticsinmotion/micstream/issues"},"os":["win32","darwin","linux"],"cpu":["x64","arm64"],"dist":{"shasum":"1f23819c469d28e933a06d365c41608bff5ce200","tarball":"https://registry.npmjs.org/@analyticsinmotion/micstream/-/micstream-0.3.0.tgz","fileCount":12,"integrity":"sha512-0Guicba4LxIhlXlYXD0q6EJtKBb5OkpQ7FvSHBcn9k2iPrkB4ThhVqeuw3Ej6LD0lv3qpxjl5alOPTDIXBTC/Q==","signatures":[{"sig":"MEUCIQCmEr4qNxYqkWA4znaS9VLJp4e+Tx9Xc1SuTARpyzPcOgIgc1S2RLxiMuvhZVCu7lFdaT8perREa4KhWbRnicjQn4U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1136898},"main":"index.js","types":"types/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"cc1e712c84bedec52da92f073bfe99ef8c214823","scripts":{"test":"node test/basic.js","build":"node-gyp rebuild","install":"node-gyp-build || node-gyp rebuild"},"_npmUser":{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"},"repository":{"url":"git+https://github.com/analyticsinmotion/micstream.git","type":"git"},"_npmVersion":"10.8.2","description":"Cross-platform microphone audio capture for Node.js with pre-built binaries. No build tools required.","directories":{},"_nodeVersion":"20.20.0","dependencies":{"node-gyp-build":"^4.6.0"},"_hasShrinkwrap":false,"devDependencies":{"node-gyp":"^12.0.0","node-addon-api":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/micstream_0.3.0_1773101727169_0.946631514693568","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package has been renamed to decibri. Install it with: npm install decibri"},"0.4.0":{"name":"@analyticsinmotion/micstream","version":"0.4.0","keywords":["microphone","audio","capture","stream","pcm","portaudio","native","prebuilt"],"license":"Apache-2.0","_id":"@analyticsinmotion/micstream@0.4.0","maintainers":[{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"}],"homepage":"https://github.com/analyticsinmotion/micstream#readme","bugs":{"url":"https://github.com/analyticsinmotion/micstream/issues"},"os":["win32","darwin","linux"],"cpu":["x64","arm64"],"dist":{"shasum":"8e41ade78a4ae019ae5a90ff69d42a8dc6c925ca","tarball":"https://registry.npmjs.org/@analyticsinmotion/micstream/-/micstream-0.4.0.tgz","fileCount":15,"integrity":"sha512-l+7xaKYwNAGbIxBR0icQHhPfIlIUs4aum8oNCBLftSa9c5/Zv7SCdxmqGQSm09AFEXHLOq//nD9dT0GWshywOA==","signatures":[{"sig":"MEUCIDgGFnGamxzs8lrvx1JX63eummp5Gd17j6LugG6GT5AKAiEArARKpNkHcVIucf1ZyiCXn7TLw/0r7jQOw+2FnlPtcS8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1146162},"main":"index.js","types":"types/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"3e571436c3db0194c62ee0c49bda5753d79f0d3f","scripts":{"test":"node test/basic.js","build":"node-gyp rebuild","install":"node-gyp-build || node-gyp rebuild"},"_npmUser":{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"},"repository":{"url":"git+https://github.com/analyticsinmotion/micstream.git","type":"git"},"_npmVersion":"10.8.2","description":"Cross-platform microphone audio capture for Node.js with pre-built binaries. No build tools required.","directories":{},"_nodeVersion":"20.20.0","dependencies":{"node-gyp-build":"^4.6.0"},"_hasShrinkwrap":false,"devDependencies":{"node-gyp":"^12.0.0","node-addon-api":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/micstream_0.4.0_1773106991194_0.7679448005709628","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This package has been renamed to decibri. Install it with: npm install decibri"}},"time":{"created":"2026-03-08T14:49:00.128Z","modified":"2026-03-29T13:18:03.732Z","0.0.1":"2026-03-08T14:49:00.371Z","0.0.2":"2026-03-08T15:08:39.085Z","0.1.0":"2026-03-09T08:32:04.350Z","0.2.0":"2026-03-09T13:18:26.294Z","0.3.0":"2026-03-10T00:15:27.457Z","0.4.0":"2026-03-10T01:43:11.423Z"},"bugs":{"url":"https://github.com/analyticsinmotion/micstream/issues"},"license":"Apache-2.0","homepage":"https://github.com/analyticsinmotion/micstream#readme","keywords":["microphone","audio","capture","stream","pcm","portaudio","native","prebuilt"],"repository":{"url":"git+https://github.com/analyticsinmotion/micstream.git","type":"git"},"description":"Cross-platform microphone audio capture for Node.js with pre-built binaries. No build tools required.","maintainers":[{"name":"rossarmstrong","email":"ross.armstrong@analyticsinmotion.com"}],"readme":"<!-- markdownlint-disable MD033 MD041 -->\n<div align=\"center\">\n  <img width=\"256\" height=\"138\" alt=\"micstream-github-logo-rectangle\" src=\"https://github.com/user-attachments/assets/0850e868-d79d-4787-911d-8126a012869c\" />\n\n# micstream\n\n  Cross-platform microphone audio capture for Node.js.\n\n  Pre-built binaries for Windows, macOS, and Linux. No build tools, no SoX, no system dependencies required.\n\n  <!-- badges: start -->\n  <table>\n    <tr>\n      <td><strong>Meta</strong></td>\n      <td>\n        <a href=\"https://www.npmjs.com/package/@analyticsinmotion/micstream\"><img src=\"https://img.shields.io/npm/v/@analyticsinmotion/micstream\" alt=\"npm version\"></a>&nbsp;\n        <a href=\"https://github.com/analyticsinmotion/micstream/blob/main/LICENSE\"><img src=\"https://img.shields.io/badge/License-Apache_2.0-blue.svg\" alt=\"Apache 2.0 License\"></a>&nbsp;\n        <a href=\"https://github.com/analyticsinmotion\"><img src=\"https://github.com/user-attachments/assets/616c530f-cf2a-4f26-8f6c-7397be513847\" alt=\"Analytics in Motion\" width=\"137\" height=\"20\"></a>\n      </td>\n    </tr>\n    <tr>\n      <td><strong>Binaries</strong></td>\n      <td>\n        <a href=\"https://github.com/analyticsinmotion/micstream/actions/workflows/prebuild.yml\"><img src=\"https://img.shields.io/github/actions/workflow/status/analyticsinmotion/micstream/prebuild.yml?job=Windows%20x64&label=Windows%20x64&logo=microsoft&logoColor=white\" alt=\"Windows x64\"></a>&nbsp;\n        <a href=\"https://github.com/analyticsinmotion/micstream/actions/workflows/prebuild.yml\"><img src=\"https://img.shields.io/github/actions/workflow/status/analyticsinmotion/micstream/prebuild.yml?job=macOS%20ARM64&label=macOS%20ARM64&logo=apple\" alt=\"macOS ARM64\"></a>&nbsp;\n        <a href=\"https://github.com/analyticsinmotion/micstream/actions/workflows/prebuild.yml\"><img src=\"https://img.shields.io/github/actions/workflow/status/analyticsinmotion/micstream/prebuild.yml?job=Linux%20x64&label=Linux%20x64&logo=linux&logoColor=white\" alt=\"Linux x64\"></a>&nbsp;\n        <a href=\"https://github.com/analyticsinmotion/micstream/actions/workflows/prebuild.yml\"><img src=\"https://img.shields.io/github/actions/workflow/status/analyticsinmotion/micstream/prebuild.yml?job=Linux%20ARM64&label=Linux%20ARM64&logo=linux&logoColor=white\" alt=\"Linux ARM64\"></a>\n      </td>\n    </tr>\n  </table>\n  <!-- badges: end -->\n</div>\n\n---\n\n## Installation\n\n```bash\nnpm install @analyticsinmotion/micstream\n```\n\nPre-compiled binaries for all supported platforms are bundled inside the package and loaded automatically by `node-gyp-build`. If no binary is available for your platform, it falls back to compiling from source (requires build tools and `libasound2-dev` on Linux).\n\n---\n\n## Usage\n\n### Stream PCM audio from the default microphone\n\n```javascript\nconst MicStream = require('@analyticsinmotion/micstream');\n\nconst mic = new MicStream();\n\nmic.on('data', (chunk) => {\n  // chunk is a Buffer of 16-bit signed integer PCM samples (little-endian)\n  // default: 16kHz, mono, 1600 frames per chunk (100ms)\n});\n\nmic.on('error', (err) => {\n  console.error('Microphone error:', err);\n});\n\n// Stop after 10 seconds\nsetTimeout(() => mic.stop(), 10000);\n```\n\n### Pipe to a file\n\n```javascript\nconst fs = require('fs');\nconst MicStream = require('@analyticsinmotion/micstream');\n\nconst mic = new MicStream({ sampleRate: 44100, channels: 2 });\nconst out = fs.createWriteStream('capture.raw');\n\nmic.pipe(out);\n\nsetTimeout(() => mic.stop(), 5000);\n```\n\n### Pipe to a speech engine\n\n```javascript\nconst MicStream = require('@analyticsinmotion/micstream');\n\nconst mic = new MicStream({ sampleRate: 16000, channels: 1 });\n\nmic.on('data', (chunk) => {\n  speechEngine.feed(chunk); // pass raw PCM directly\n});\n```\n\n### TypeScript\n\nTypeScript definitions are bundled. No `@types/` package needed.\n\n```typescript\nimport MicStream, { DeviceInfo, MicStreamOptions } from '@analyticsinmotion/micstream';\n\nconst options: MicStreamOptions = { sampleRate: 16000, channels: 1 };\nconst mic = new MicStream(options);\n\nmic.on('data', (chunk: Buffer) => {\n  // zero-copy Int16 view over the same memory\n  const samples = new Int16Array(chunk.buffer, chunk.byteOffset, chunk.length / 2);\n});\n\nmic.on('backpressure', () => console.warn('Consumer too slow'));\n\nconst devices: DeviceInfo[] = MicStream.devices();\n```\n\n---\n\n## API\n\n### `new MicStream(options?)`\n\nCreates a Readable stream that captures from the system default microphone.\n\n| Option | Type | Default | Description |\n| --- | --- | --- | --- |\n| `sampleRate` | number | `16000` | Samples per second (1000–384000) |\n| `channels` | number | `1` | Number of input channels (1–32) |\n| `framesPerBuffer` | number | `1600` | Frames per audio callback (64–65536) |\n| `device` | number \\| string | system default | Device index from `MicStream.devices()` or case-insensitive name substring |\n| `format` | `'int16'` \\| `'float32'` | `'int16'` | Sample encoding — 16-bit signed integer or 32-bit IEEE 754 float |\n| `vad` | boolean | `false` | Enable voice activity detection |\n| `vadThreshold` | number | `0.01` | RMS energy threshold for speech (0–1) |\n| `vadHoldoff` | number | `300` | Silence holdoff in ms before `'silence'` is emitted |\n\nStandard Node.js `Readable` stream options (e.g. `highWaterMark`) are also accepted.\n\n### `mic.stop()`\n\nStops microphone capture and ends the stream. Safe to call multiple times.\n\n### Event: `'backpressure'`\n\nEmitted when `push()` returns `false`, meaning the stream's internal buffer is full and the consumer is reading too slowly. Because a microphone cannot be paused, audio chunks will continue to arrive. Callers should drain the stream or drop data to avoid unbounded memory growth.\n\n### Event: `'speech'`\n\nEmitted when the RMS energy of an audio chunk crosses `vadThreshold`. Requires `vad: true`.\n\n### Event: `'silence'`\n\nEmitted when audio stays below `vadThreshold` for `vadHoldoff` ms after a speech period. Requires `vad: true`.\n\n### `mic.isOpen`\n\n`true` if the microphone is currently capturing.\n\n### `MicStream.devices()`\n\nReturns an array of available input devices on the system.\n\n```javascript\nconst devices = MicStream.devices();\n// [\n//   { index: 0, name: 'Built-in Microphone', maxInputChannels: 1, defaultSampleRate: 44100, isDefault: true },\n//   ...\n// ]\n```\n\n### `MicStream.version()`\n\nReturns version information for micstream and the bundled PortAudio.\n\n```javascript\nMicStream.version();\n// { micstream: '0.4.0', portaudio: 'PortAudio V19.7.0-devel...' }\n```\n\n---\n\n## Examples\n\nRunnable examples are in [`examples/`](examples/).\n\n### Capture to WAV file\n\nNo external dependencies.\n\n```bash\nnode examples/wav-capture.js\n# writes capture.wav (5 seconds, 16 kHz mono)\n```\n\n### Stream to WebSocket\n\nThe WebSocket examples require the `ws` package, which is **not** bundled with micstream. Install it before running:\n\n```bash\nnpm install ws\n```\n\nThen in two terminals:\n\n```bash\n# Terminal 1 — start receiver\nnode examples/websocket-server.js\n\n# Terminal 2 — start streaming\nnode examples/websocket-stream.js\n# streams raw PCM to ws://localhost:8080\n```\n\n---\n\n## Audio format\n\nAll audio is captured as **16-bit signed integer PCM, little-endian**. This is the raw format expected by most speech and wake-word engines (Vosk, sherpa-onnx, whisper.cpp, openWakeWord).\n\nEach `data` event emits a `Buffer` where every 2 bytes is one 16-bit sample:\n\n```javascript\nmic.on('data', (chunk) => {\n  const samples = new Int16Array(chunk.buffer, chunk.byteOffset, chunk.length / 2);\n  // samples[0], samples[1], ...\n});\n```\n\n---\n\n## Platform Support\n\n### Pre-built binaries (zero setup)\n\n| Platform | Architecture | Audio Backend |\n| --- | --- | --- |\n| Windows 11 | x64 | WASAPI |\n| macOS (Apple Silicon) | arm64 | CoreAudio |\n| Linux | x64 | ALSA |\n| Linux | arm64 | ALSA |\n\n### Source build fallback (requires build tools)\n\n| Platform | Requirements |\n| --- | --- |\n| macOS Intel (pre-2020) | Xcode CLI tools: `xcode-select --install` |\n| Windows ARM64 | Visual C++ Build Tools |\n\n### Not supported\n\n| Platform | Reason |\n| --- | --- |\n| Windows 32-bit | N-API native addons require 64-bit |\n\n---\n\n## Building from source\n\nRequires Node.js >= 16, node-gyp, and platform build tools.\n\n**Linux:**\n\n```bash\nsudo apt-get install -y build-essential libasound2-dev\n```\n\n**macOS:**\n\n```bash\nxcode-select --install\n```\n\n**Windows:**\nInstall [Visual C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/).\n\nThen:\n\n```bash\ngit clone --recurse-submodules https://github.com/analyticsinmotion/micstream.git\ncd micstream\nnpm install\nnpm run build\n```\n\n---\n\n## How it works\n\nmicstream wraps [PortAudio](http://www.portaudio.com/), the standard cross-platform audio I/O library, as a Node.js native addon using [N-API](https://nodejs.org/api/n-api.html). PortAudio is compiled from source and statically linked, so there is no system PortAudio dependency.\n\nThe native addon opens the default input device, runs a PortAudio callback in an audio thread, and forwards PCM chunks to JavaScript via an N-API `ThreadSafeFunction`. The JavaScript layer wraps this in a standard Node.js `Readable` stream.\n\n---\n\n## License\n\nApache-2.0 © [Analytics in Motion](https://github.com/analyticsinmotion)\n","readmeFilename":"README.md"}