{"id":24161566,"url":"https://github.com/zcaceres/node-record-lpcm16-ts","last_synced_at":"2026-02-02T15:04:27.643Z","repository":{"id":255446361,"uuid":"852485288","full_name":"zcaceres/node-record-lpcm16-ts","owner":"zcaceres","description":"node-record-lpcm16 but now with Typescript","archived":false,"fork":false,"pushed_at":"2024-09-05T01:40:55.000Z","size":72,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T16:08:33.126Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zcaceres.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-04T22:18:53.000Z","updated_at":"2025-08-06T22:20:12.000Z","dependencies_parsed_at":"2024-09-06T08:48:32.264Z","dependency_job_id":null,"html_url":"https://github.com/zcaceres/node-record-lpcm16-ts","commit_stats":null,"previous_names":["zcaceres/node-record-lpcm16-ts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zcaceres/node-record-lpcm16-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaceres%2Fnode-record-lpcm16-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaceres%2Fnode-record-lpcm16-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaceres%2Fnode-record-lpcm16-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaceres%2Fnode-record-lpcm16-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zcaceres","download_url":"https://codeload.github.com/zcaceres/node-record-lpcm16-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaceres%2Fnode-record-lpcm16-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29013749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T14:58:54.169Z","status":"ssl_error","status_checked_at":"2026-02-02T14:58:51.285Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-12T17:17:21.341Z","updated_at":"2026-02-02T15:04:27.624Z","avatar_url":"https://github.com/zcaceres.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-record-lpcm16-ts\n\nA TypeScript module for recording 16-bit signed-integer linear pulse modulation code WAV audio files from your microphone!\n\nThis library is a Typescript port of the excellent [node-record-lpcm16](https://github.com/gillesdemey/node-record-lpcm16), which has not been updated in years and lacked Typescript bindings and modern syntax. Credit goes to Gilles de Mey for the original implementation.\n\nThe recorded audio files are fully compatible with both the Google Speech to Text API (v2) and the Wit.ai Speech API.\n\n## Installation\n\n```\nnpm install node-record-lpcm16-ts\n```\n\n## Dependencies\n\nRun `npm install` to install all necessary dependencies.\n\nThis module requires [SoX](http://sox.sourceforge.net) to be installed and available in your `$PATH`.\n\n### Installation by OS\n\n- **Mac OS**: `brew install sox`\n- **Linux**: `sudo apt-get install sox libsox-fmt-all`\n- **Windows**: Use [chocolatey](https://chocolatey.org/install) to install SoX:\n  ```\n  choco install sox.portable\n  ```\n\n## Usage\n\n```typescript\nimport { record } from 'node-record-lpcm16-ts';\nimport fs from 'fs';\n\nconst file = fs.createWriteStream('test.wav', { encoding: 'binary' });\n\nconst recording = record({\n  sampleRate: 44100,\n  channels: 1\n});\n\nrecording.stream().pipe(file);\n\n// Stop recording after 3 seconds\nsetTimeout(() =\u003e {\n  recording.stop();\n}, 3000);\n```\n\n### Controlling the Recording\n\nYou can pause, resume, and stop the recording manually:\n\n```typescript\nimport { record } from 'node-record-lpcm16-ts';\nimport fs from 'fs';\n\nconst file = fs.createWriteStream('test.wav', { encoding: 'binary' });\n\nconst recording = record();\nrecording.stream().pipe(file);\n\n// Pause recording after one second\nsetTimeout(() =\u003e {\n  recording.pause();\n}, 1000);\n\n// Resume another second later\nsetTimeout(() =\u003e {\n  recording.resume();\n}, 2000);\n\n// Stop recording after three seconds\nsetTimeout(() =\u003e {\n  recording.stop();\n}, 3000);\n```\n\n## Options\n\n```typescript\ninterface RecordingOptions {\n  sampleRate: number;      // audio sample rate (default: 16000)\n  channels: number;        // number of channels (default: 1)\n  compress: boolean;       // compress the audio (default: false)\n  threshold: number;       // silence threshold (default: 0.5)\n  thresholdStart: number | null; // silence threshold to start recording (default: null)\n  thresholdEnd: number | null;   // silence threshold to end recording (default: null)\n  silence: string;         // seconds of silence before ending (default: '1.0')\n  recorder: string;        // recorder to use (default: 'sox')\n  endOnSilence: boolean;   // automatically end on silence (default: false)\n  audioType: string;       // audio type to record (default: 'wav')\n  device?: string;         // recording device (e.g., 'plughw:1')\n}\n```\n\n## Recorders\n\nThe following recorders are supported:\n\n- rec\n- sox\n- arecord\n\nNote: Not all recorders support all features.\n\n## Error Handling\n\nTo handle errors, add an error event listener to the stream:\n\n```typescript\nrecording.stream()\n  .on('error', (err: Error) =\u003e {\n    console.error('Recorder error:', err);\n  })\n  .pipe(file);\n```\n\n## Debugging\n\nDebug logging is implemented with [debug](https://github.com/debug-js/debug):\n\n```\nDEBUG=record node your-script.js\n```\n\n## License\n\nThis project is licensed under the ISC License copywritten by the original author [Gilles de Mey](https://github.com/gillesdemey)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcaceres%2Fnode-record-lpcm16-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzcaceres%2Fnode-record-lpcm16-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcaceres%2Fnode-record-lpcm16-ts/lists"}