{"_id":"@clarionhq/recorder","_rev":"4-3b8474d9fa7d8b1751c114fae0860ee0","name":"@clarionhq/recorder","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"@clarionhq/recorder","version":"0.0.1","keywords":["react-native","audio","speech","voice"],"license":"MIT","_id":"@clarionhq/recorder@0.0.1","maintainers":[{"name":"anvesh-dev","email":"anveshk282@gmail.com"}],"homepage":"https://github.com/clarionhq/clarion","bugs":{"url":"https://github.com/clarionhq/clarion/issues"},"dist":{"shasum":"c06d61e51241065abd6fde553198d346f009517a","tarball":"https://registry.npmjs.org/@clarionhq/recorder/-/recorder-0.0.1.tgz","fileCount":2,"integrity":"sha512-3nVfiAon4NxO7jEUmFWKYhmJqJlKqvM/LFghTNfrG/XZTUeAbtwDO8NShmlFUwXzDe2rRWkIfqWfeam27Xysvw==","signatures":[{"sig":"MEYCIQCzSE+qBGVEDhe+24BKlfRa2cXO3+DPzrwwVEGG/KC5igIhAJsnXr+BfoMEIqT5F9DuCiof+Z7raE0kkBTUY6tfCpi9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":499},"main":"index.js","_npmUser":{"name":"anvesh-dev","email":"anveshk282@gmail.com"},"repository":{"url":"git+https://github.com/clarionhq/clarion.git","type":"git"},"_npmVersion":"11.5.1","description":"Clarion recorder — placeholder, full release coming soon","directories":{},"_nodeVersion":"24.5.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/recorder_0.0.1_1779084516887_0.3982338719890992","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@clarionhq/recorder","version":"0.1.0","keywords":["react-native","audio","recorder","pcm","m4a","aac","audiorecord","avaudioengine","nitro-modules","turbomodule","fabric","new-architecture"],"license":"MIT","_id":"@clarionhq/recorder@0.1.0","maintainers":[{"name":"anvesh-dev","email":"anveshk282@gmail.com"}],"homepage":"https://github.com/Th4nderG0d/clarion#readme","bugs":{"url":"https://github.com/Th4nderG0d/clarion/issues"},"dist":{"shasum":"9d33edd1bfa42b4575ae6a277f011509b13ed764","tarball":"https://registry.npmjs.org/@clarionhq/recorder/-/recorder-0.1.0.tgz","fileCount":90,"integrity":"sha512-e1J7XhmuKZlzhQVUguW5clYEiRvvwsTH05QIyMgJmEJyCwdEsMt4ep5Z6drbfoLJUPvTES38/4fQgsij/lgRmw==","signatures":[{"sig":"MEUCICUj57wf2jTvUI2MBlP1lvVlUCJrdS9v3vUCddUy5f90AiEAp6f1mXi5qhtMH0qRCA07sIHw9a9La/fh/CDOnuyEqgA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":233697},"main":"lib/index.js","_from":"file:clarionhq-recorder-0.1.0.tgz","types":"lib/index.d.ts","source":"src/index.ts","scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf lib nitrogen","typecheck":"tsc -p tsconfig.json --noEmit","nitro:codegen":"nitrogen"},"_npmUser":{"name":"anvesh-dev","email":"anveshk282@gmail.com"},"_resolved":"/private/var/folders/l1/vglrz9gn7ln7_4j02tyqjpjc0000gp/T/deae3f7ddbf33660571a29d3ffca1a1a/clarionhq-recorder-0.1.0.tgz","_integrity":"sha512-e1J7XhmuKZlzhQVUguW5clYEiRvvwsTH05QIyMgJmEJyCwdEsMt4ep5Z6drbfoLJUPvTES38/4fQgsij/lgRmw==","repository":{"url":"git+https://github.com/Th4nderG0d/clarion.git","type":"git","directory":"packages/recorder"},"_npmVersion":"11.5.1","description":"Clarion recorder — PCM capture to m4a for React Native (offline-first)","directories":{},"_nodeVersion":"24.5.0","dependencies":{"@clarionhq/core":"0.1.0"},"react-native":"src/index.ts","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"18.3.1","nitrogen":"^0.35.6","react-native":"0.77.3","react-native-nitro-modules":"^0.35.6"},"peerDependencies":{"react":">=18.3.1","react-native":">=0.77.0","react-native-nitro-modules":">=0.35.0"},"_npmOperationalInternal":{"tmp":"tmp/recorder_0.1.0_1779168053148_0.3878611225911144","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@clarionhq/recorder","version":"0.1.1","keywords":["react-native","audio","recorder","pcm","m4a","aac","audiorecord","avaudioengine","nitro-modules","turbomodule","fabric","new-architecture"],"license":"MIT","_id":"@clarionhq/recorder@0.1.1","maintainers":[{"name":"anvesh-dev","email":"anveshk282@gmail.com"}],"homepage":"https://github.com/Th4nderG0d/clarion#readme","bugs":{"url":"https://github.com/Th4nderG0d/clarion/issues"},"dist":{"shasum":"9ab7f785fff275f38b83175aeabbe18ce8d2b5ef","tarball":"https://registry.npmjs.org/@clarionhq/recorder/-/recorder-0.1.1.tgz","fileCount":93,"integrity":"sha512-lQgkOcCqHYatF8rZTCl9wFPWWlyrDZzIjw+XvVHbkEVJOMtSPvDycHtxnEOdX3q8e4Rq+beqUgBNWyrHCAAWrg==","signatures":[{"sig":"MEUCIGbbXHizMNg5SY7phMtb14yLKcoCPFx2NiDTaKk8yNokAiEA6VpTAQxMAxrUUqdcOTxhdrPFfcBIpAlMrOxqth0pEY8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":234228},"main":"lib/index.js","_from":"file:clarionhq-recorder-0.1.1.tgz","types":"lib/index.d.ts","source":"src/index.ts","scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf lib nitrogen","typecheck":"tsc -p tsconfig.json --noEmit","nitro:codegen":"nitrogen"},"_npmUser":{"name":"anvesh-dev","email":"anveshk282@gmail.com"},"_resolved":"/private/var/folders/l1/vglrz9gn7ln7_4j02tyqjpjc0000gp/T/cb10711ba38d529dbc1a8a28c2cf65df/clarionhq-recorder-0.1.1.tgz","_integrity":"sha512-lQgkOcCqHYatF8rZTCl9wFPWWlyrDZzIjw+XvVHbkEVJOMtSPvDycHtxnEOdX3q8e4Rq+beqUgBNWyrHCAAWrg==","repository":{"url":"git+https://github.com/Th4nderG0d/clarion.git","type":"git","directory":"packages/recorder"},"_npmVersion":"11.5.1","description":"Clarion recorder — PCM capture to m4a for React Native (offline-first)","directories":{},"_nodeVersion":"24.5.0","dependencies":{"@clarionhq/core":"0.1.0"},"react-native":"src/index.ts","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"18.3.1","nitrogen":"^0.35.6","react-native":"0.77.3","react-native-nitro-modules":"^0.35.6"},"peerDependencies":{"react":">=18.3.1","react-native":">=0.77.0","react-native-nitro-modules":">=0.35.0"},"_npmOperationalInternal":{"tmp":"tmp/recorder_0.1.1_1779171163453_0.33588661144313314","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@clarionhq/recorder","version":"0.1.2","description":"Clarion recorder — PCM capture to m4a for React Native (offline-first)","main":"lib/index.js","types":"lib/index.d.ts","react-native":"src/index.ts","source":"src/index.ts","scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","nitro:codegen":"nitrogen","clean":"rm -rf lib nitrogen"},"keywords":["react-native","audio","recorder","pcm","m4a","aac","audiorecord","avaudioengine","nitro-modules","turbomodule","fabric","new-architecture"],"dependencies":{"@clarionhq/core":"workspace:*"},"peerDependencies":{"react":">=18.3.1","react-native":">=0.77.0","react-native-nitro-modules":">=0.35.0"},"devDependencies":{"nitrogen":"^0.35.6","react":"18.3.1","react-native":"0.77.3","react-native-nitro-modules":"^0.35.6"},"license":"MIT","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/Th4nderG0d/clarion.git","directory":"packages/recorder"},"_id":"@clarionhq/recorder@0.1.2","gitHead":"2a9ce8d3359db22bb9002e010d31074ff31eea3b","bugs":{"url":"https://github.com/Th4nderG0d/clarion/issues"},"homepage":"https://github.com/Th4nderG0d/clarion#readme","_nodeVersion":"24.5.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-IFNlwdfJSAq3QuLbtPQilXR1b42poZD0OgVxAT+w/iSgqr5icHAG2WFc5cxD1IoVDk357jgJWVl8U85QTDes5g==","shasum":"11ff72466eb842ef8387b19e96e2505147214b27","tarball":"https://registry.npmjs.org/@clarionhq/recorder/-/recorder-0.1.2.tgz","fileCount":92,"unpackedSize":233642,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH5AoDY0ZBFcaMT39ow5XOnhkxJacGMnXwMnyo7Az6LXAiAKGEdObMicAK27Vs5LtkfonIY0JR4hA3EpAvq/P3nqKA=="}]},"_npmUser":{"name":"anvesh-dev","email":"anveshk282@gmail.com"},"directories":{},"maintainers":[{"name":"anvesh-dev","email":"anveshk282@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/recorder_0.1.2_1779266525813_0.24382758899272416"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T06:08:36.785Z","modified":"2026-05-20T08:42:06.104Z","0.0.1":"2026-05-18T06:08:37.033Z","0.1.0":"2026-05-19T05:20:53.300Z","0.1.1":"2026-05-19T06:12:43.607Z","0.1.2":"2026-05-20T08:42:05.969Z"},"bugs":{"url":"https://github.com/Th4nderG0d/clarion/issues"},"license":"MIT","homepage":"https://github.com/Th4nderG0d/clarion#readme","keywords":["react-native","audio","recorder","pcm","m4a","aac","audiorecord","avaudioengine","nitro-modules","turbomodule","fabric","new-architecture"],"repository":{"type":"git","url":"git+https://github.com/Th4nderG0d/clarion.git","directory":"packages/recorder"},"description":"Clarion recorder — PCM capture to m4a for React Native (offline-first)","maintainers":[{"name":"anvesh-dev","email":"anveshk282@gmail.com"}],"readme":"# @clarionhq/recorder\n\nReact Native microphone capture → AAC `.m4a`. Built on the New Architecture with [Nitro Modules](https://nitro.margelo.com). 16 KB page-size compliant.\n\n```tsx\nimport { RecorderEngine } from '@clarionhq/recorder';\n\nconst engine = new RecorderEngine({ emitAudioLevel: true });\nengine.on(e => {\n  if (e.type === 'state') setState(e.state);\n  if (e.type === 'audio-level') setRms(e.rms);\n  if (e.type === 'recording-complete') console.log(e.result.uri);\n});\n\nawait engine.start();   // permission, prepare and record — one call\n// later…\nawait engine.stop();    // finalizes the m4a and resets to `idle`\n```\n\n## Install\n\n```sh\npnpm add @clarionhq/recorder @clarionhq/core react-native-nitro-modules\ncd ios && pod install\n```\n\n## Requirements\n\n| | |\n|---|---|\n| React Native | 0.77+ with New Architecture + Hermes |\n| Android | API 26+ |\n| iOS | 15.1+ |\n| Expo | bare workflow only (prebuild) |\n\n## Permissions\n\n**Android** — `RECORD_AUDIO` is auto-merged into your manifest. Request at runtime:\n\n```tsx\nawait PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);\n```\n\n**iOS** — add `NSMicrophoneUsageDescription` to `Info.plist`. The library prompts the user automatically on first `start()`.\n\n## API\n\n### `new RecorderEngine(options?)`\n\n```ts\ntype RecorderEngineOptions = {\n  outputDirectory?: string;       // default: app cache dir / 'clarion-recorder'\n  filenamePrefix?: string;        // default: 'clarion'\n  rotateAfterMs?: number;         // split into chunks every N ms\n  emitAudioLevel?: boolean;       // default: false\n  audioLevelIntervalMs?: number;  // default: 50\n  aacBitrate?: number;            // default: 32_000\n};\n```\n\n### Lifecycle\n\n| Method | Behavior |\n|---|---|\n| `start()` | Begin recording. Auto-handles permission + `prepare()` from `idle`/`error`. |\n| `pause()` / `resume()` | Gapless pause — audio session stays warm. |\n| `stop()` | Finalize the m4a → fire `recording-complete` → state → `idle`. |\n| `discard()` | Abort and delete the partial file → state → `idle`. |\n| `release()` | Permanently dispose. Engine cannot be reused after this. |\n| `prepare()` | Optional. Pre-warm the audio session before showing your record UI. |\n\n### Events\n\n```ts\ntype ClarionEvent =\n  | { type: 'state'; state: EngineState }\n  | { type: 'audio-level'; rms: number; peak: number }   // 0..1 linear (not dB)\n  | { type: 'chunk'; uri: string; startMs: number; endMs: number; sizeBytes: number }\n  | { type: 'recording-complete'; result: RecorderResult }\n  | { type: 'error'; error: ClarionError };\n```\n\nStates: `idle → preparing → ready → starting → recording → paused → stopping → idle`, plus `error` and `released` as terminals. Method calls from invalid states throw `ClarionError({ code: 'INVALID_STATE' })`; runtime errors arrive via the `error` event. See [`@clarionhq/core/errors`](https://github.com/Th4nderG0d/clarion/blob/main/packages/core/src/errors.ts) for the full code list.\n\n### React cleanup\n\n```tsx\nuseEffect(() => {\n  const engine = new RecorderEngine();\n  const off = engine.on(handle);\n  return () => { off(); engine.release(); };   // important — frees the mic\n}, []);\n```\n\n## Limitations\n\n- **No background recording.** App suspending mid-recording will truncate the file. Callers who need background must configure `UIBackgroundModes: audio` (iOS) + a foreground service (Android) themselves; opt-in support may land in v0.2.\n- **No playback.** Use [`expo-av`](https://docs.expo.dev/versions/latest/sdk/audio/) or [`react-native-track-player`](https://rntp.dev) — Clarion produces m4a files that play cleanly in both.\n- **No managed Expo support.** Bare workflow / prebuild only until a config plugin ships.\n\n## Troubleshooting\n\n| Symptom | Fix |\n|---|---|\n| iOS build: `fmt` library `consteval` errors on Xcode 26 | Add `FMT_USE_CONSTEVAL=0` patch to your `Podfile` post_install (see `example/ios/Podfile` in the repo). |\n| `PERMISSION_DENIED` fires repeatedly | iOS: confirm `NSMicrophoneUsageDescription` is in Info.plist. Android: confirm `PermissionsAndroid.request(RECORD_AUDIO)` returned `granted` before calling `start()`. |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}