{"_id":"@desert-ant-labs/ear","_rev":"6-5299f3c673ea12d75f877f9ee8f69f1c","name":"@desert-ant-labs/ear","dist-tags":{"latest":"3.5.0"},"versions":{"3.1.0":{"name":"@desert-ant-labs/ear","version":"3.1.0","keywords":["language-identification","language-detection","langid","spoken-language","speech","audio","on-device","wasm","litert","isomorphic"],"license":"SEE LICENSE IN LICENSE.md","_id":"@desert-ant-labs/ear@3.1.0","maintainers":[{"name":"finnvoorhees","email":"finn@detail.co"},{"name":"laurierrochon","email":"laurier@detail.co"},{"name":"pveugen","email":"paul@pave4.com"},{"name":"akagabi","email":"gabesuit@gmail.com"}],"homepage":"https://desertant.com/models/ear/","bugs":{"url":"https://github.com/Desert-Ant-Labs/desert-ant-core/issues"},"dist":{"shasum":"83df6c0488bafeedfb544e7374d238a53225411d","tarball":"https://registry.npmjs.org/@desert-ant-labs/ear/-/ear-3.1.0.tgz","fileCount":31,"integrity":"sha512-ivwBioZmY/n5atxF6T/vzZodQGsXgusXbsA4GveInDCVYplECQVIkEKJPO+1IpHx0wXSh+poQGBZd9lrmoLo/w==","signatures":[{"sig":"MEUCICcuinZvjZip4ANsU0qLFYscaigQ1cWYBclSixwpBM9uAiEArRdHzR/TISNtGehrhhRX9IIUpVes+/ok887BC0BcESo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":173588812},"main":"./browser.js","type":"module","types":"./index.d.ts","browser":"./browser.js","exports":{".":{"types":"./index.d.ts","default":"./browser.js"},"./wasm":"./dist/EarWeb.wasm","./native":{"types":"./index.d.ts","default":"./node.js"},"./browser":{"types":"./index.d.ts","default":"./browser.js"}},"gitHead":"9e11fdf9566df2e34b9516ac76403b1ff0f839d8","imports":{"#platform":{"browser":"./platform-browser.js","default":"./platform-node.js"}},"scripts":{"test":"node --test test/ear.test.mjs"},"_npmUser":{"name":"finnvoorhees","email":"finn@detail.co"},"repository":{"url":"git+https://github.com/Desert-Ant-Labs/desert-ant-core.git","type":"git","directory":"packages/ear-node"},"_npmVersion":"10.9.8","description":"On-device spoken language identification for JavaScript: name the language of a recording before you transcribe it. Runs in the browser (WebAssembly + LiteRT.js) and server-side in Node (native), from one import.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@desert-ant-labs/core":"^3.1.0","@bjorn3/browser_wasi_shim":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@litertjs/core":"^2.5.2"},"peerDependencies":{"@litertjs/core":">=2.1.0"},"optionalDependencies":{"koffi":"^2.9.0"},"peerDependenciesMeta":{"@litertjs/core":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ear_3.1.0_1787931352350_0.9030031510371375","host":"s3://npm-registry-packages-npm-production"}},"3.2.0":{"name":"@desert-ant-labs/ear","version":"3.2.0","keywords":["language-identification","language-detection","langid","spoken-language","speech","audio","on-device","wasm","litert","isomorphic"],"license":"SEE LICENSE IN LICENSE.md","_id":"@desert-ant-labs/ear@3.2.0","maintainers":[{"name":"finnvoorhees","email":"finn@detail.co"},{"name":"laurierrochon","email":"laurier@detail.co"},{"name":"pveugen","email":"paul@pave4.com"},{"name":"akagabi","email":"gabesuit@gmail.com"}],"homepage":"https://desertant.com/models/ear/","bugs":{"url":"https://github.com/Desert-Ant-Labs/desert-ant-core/issues"},"dist":{"shasum":"ceba81576b3e034ed9f7a60b4727fe031275c9a8","tarball":"https://registry.npmjs.org/@desert-ant-labs/ear/-/ear-3.2.0.tgz","fileCount":31,"integrity":"sha512-2E7wfeMWU3GswsTRR9XxTfOimW7Y/YCtzmL6MJ8ZCXtctzpL83/LgKMM243VVpw54E3fcLumnaGLhiEslhbJQw==","signatures":[{"sig":"MEYCIQDv6L1ZITLsk01SVtic1dPwWpg45NRAMdplaq0ca43O9gIhALVpjLkMj94Iy/LF5yxhfNhtYEhfJrTOc4A5RG8xngl4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIEyeuP4kVMj7ooZNXmgGWpVGytmM3z9fLO8v8fRA+bVLAiEA7/vxlpUliKL0YiP/dV7S2JQf2WOHQ8siCSMjRaN6P0s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":173753455},"main":"./browser.js","type":"module","types":"./index.d.ts","browser":"./browser.js","exports":{".":{"types":"./index.d.ts","default":"./browser.js"},"./wasm":"./dist/EarWeb.wasm","./native":{"types":"./index.d.ts","default":"./node.js"},"./browser":{"types":"./index.d.ts","default":"./browser.js"}},"gitHead":"3a8d13cd1c4f027f095822956d9b08eb5ce6684d","imports":{"#platform":{"browser":"./platform-browser.js","default":"./platform-node.js"}},"scripts":{"test":"DAL_USAGE_DISABLED=1 node --test test/ear.test.mjs"},"_npmUser":{"name":"finnvoorhees","email":"finn@detail.co"},"repository":{"url":"git+https://github.com/Desert-Ant-Labs/desert-ant-core.git","type":"git","directory":"packages/ear-node"},"_npmVersion":"10.9.8","description":"On-device spoken language identification for JavaScript: name the language of a recording before you transcribe it. Runs in the browser (WebAssembly + LiteRT.js) and server-side in Node (native), from one import.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@desert-ant-labs/core":"^3.2.0","@bjorn3/browser_wasi_shim":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@litertjs/core":"^2.5.2"},"peerDependencies":{"@litertjs/core":">=2.1.0"},"optionalDependencies":{"koffi":"^2.9.0"},"peerDependenciesMeta":{"@litertjs/core":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ear_3.2.0_1789734058320_0.3757185374670202","host":"s3://npm-registry-packages-npm-production"}},"3.3.0":{"name":"@desert-ant-labs/ear","version":"3.3.0","keywords":["language-identification","language-detection","langid","spoken-language","speech","audio","on-device","wasm","litert","isomorphic"],"license":"SEE LICENSE IN LICENSE.md","_id":"@desert-ant-labs/ear@3.3.0","maintainers":[{"name":"finnvoorhees","email":"finn@detail.co"},{"name":"laurierrochon","email":"laurier@detail.co"},{"name":"pveugen","email":"paul@pave4.com"},{"name":"akagabi","email":"gabesuit@gmail.com"}],"homepage":"https://desertant.com/models/ear/","bugs":{"url":"https://github.com/Desert-Ant-Labs/desert-ant-core/issues"},"dist":{"shasum":"cb3043252ad9d4e1819e614918afdd68c48df0a8","tarball":"https://registry.npmjs.org/@desert-ant-labs/ear/-/ear-3.3.0.tgz","fileCount":31,"integrity":"sha512-QGssSxfnyaR3IRvit5ZYZuddhhwelrAGAej3HDsF/6uvzdLtxhoJsm4aa64G2W9mcA9LSKCG5cUo1K4npWlSLQ==","signatures":[{"sig":"MEUCIQD/ejFQS4jVmvOCpRhaO2v+g6q+6QAQmPpizxrMDP02egIgOg/0d78x80Wa3xKw1sibsvBjbORDFRXvVlO+VB+8VtE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDA9OUqM/+QuisyRpPw41rbRRRuXRHAuLEwuWCe2OZ8YgIhAPYsgjsUStQZClpJdV0NIoa+uMeq+ibVTjkYSevUwf0Q","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":173758055},"main":"./browser.js","type":"module","types":"./index.d.ts","browser":"./browser.js","exports":{".":{"types":"./index.d.ts","default":"./browser.js"},"./wasm":"./dist/EarWeb.wasm","./native":{"types":"./index.d.ts","default":"./node.js"},"./browser":{"types":"./index.d.ts","default":"./browser.js"}},"gitHead":"0711f8907188ca1ee85b2a0fa37ad7aa64b9a750","imports":{"#platform":{"browser":"./platform-browser.js","default":"./platform-node.js"}},"scripts":{"test":"DAL_USAGE_DISABLED=1 node --test test/ear.test.mjs"},"_npmUser":{"name":"finnvoorhees","email":"finn@detail.co"},"repository":{"url":"git+https://github.com/Desert-Ant-Labs/desert-ant-core.git","type":"git","directory":"packages/ear-node"},"_npmVersion":"10.9.8","description":"On-device spoken language identification for JavaScript: name the language of a recording before you transcribe it. Runs in the browser (WebAssembly + LiteRT.js) and server-side in Node (native), from one import.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@desert-ant-labs/core":"^3.3.0","@bjorn3/browser_wasi_shim":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@litertjs/core":"^2.5.2"},"peerDependencies":{"@litertjs/core":">=2.1.0"},"optionalDependencies":{"koffi":"^2.9.0"},"peerDependenciesMeta":{"@litertjs/core":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ear_3.3.0_1790031860990_0.4515684681142689","host":"s3://npm-registry-packages-npm-production"}},"3.3.1":{"name":"@desert-ant-labs/ear","version":"3.3.1","keywords":["language-identification","language-detection","langid","spoken-language","speech","audio","on-device","wasm","litert","isomorphic"],"license":"SEE LICENSE IN LICENSE.md","_id":"@desert-ant-labs/ear@3.3.1","maintainers":[{"name":"finnvoorhees","email":"finn@detail.co"},{"name":"laurierrochon","email":"laurier@detail.co"},{"name":"pveugen","email":"paul@pave4.com"},{"name":"akagabi","email":"gabesuit@gmail.com"}],"homepage":"https://desertant.com/models/ear/","bugs":{"url":"https://github.com/Desert-Ant-Labs/desert-ant-core/issues"},"dist":{"shasum":"ef1d5102028a7cdb7b884e57af52f33becd95e10","tarball":"https://registry.npmjs.org/@desert-ant-labs/ear/-/ear-3.3.1.tgz","fileCount":31,"integrity":"sha512-hku4Js0/2+N4oiLTFyBHrAqsk646e5FTHzhDDUnEWST98hzyXO6Vy5kVZHNBxXL5EJ+aYsEKlo2fupRerWBvzQ==","signatures":[{"sig":"MEUCIQCCmEcmV53poZ/hKS+sYUd7jWgWEFVYy/wmjglGUR+1LgIgYJRmu+QxwGkUWGVt4ke3Vwbch44xyvBo/oz30NuQgm0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQCcYPNGE+aSc8n2yFwxZwv2zpVZHImI9FpU0UzY+JJE2gIhAJBtNl+1y3VJsXIItt2lQTA4glF+AwW868wGdkkJqVfJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":173862656},"main":"./browser.js","type":"module","types":"./index.d.ts","browser":"./browser.js","exports":{".":{"types":"./index.d.ts","default":"./browser.js"},"./wasm":"./dist/EarWeb.wasm","./native":{"types":"./index.d.ts","default":"./node.js"},"./browser":{"types":"./index.d.ts","default":"./browser.js"}},"gitHead":"7e9107f47d8f2c56fbd5a1b93bae637f1c92a92c","imports":{"#platform":{"browser":"./platform-browser.js","default":"./platform-node.js"}},"scripts":{"test":"DAL_USAGE_DISABLED=1 node --test test/ear.test.mjs"},"_npmUser":{"name":"akagabi","email":"gabesuit@gmail.com"},"repository":{"url":"git+https://github.com/Desert-Ant-Labs/desert-ant-core.git","type":"git","directory":"packages/ear-node"},"_npmVersion":"10.9.8","description":"On-device spoken language identification for JavaScript: name the language of a recording before you transcribe it. Runs in the browser (WebAssembly + LiteRT.js) and server-side in Node (native), from one import.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@desert-ant-labs/core":"^3.3.1","@bjorn3/browser_wasi_shim":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@litertjs/core":"^2.5.2"},"peerDependencies":{"@litertjs/core":">=2.1.0"},"optionalDependencies":{"koffi":"^2.9.0"},"peerDependenciesMeta":{"@litertjs/core":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ear_3.3.1_1790125997486_0.813911548812317","host":"s3://npm-registry-packages-npm-production"}},"3.4.0":{"name":"@desert-ant-labs/ear","version":"3.4.0","keywords":["language-identification","language-detection","langid","spoken-language","speech","audio","on-device","wasm","litert","isomorphic"],"license":"SEE LICENSE IN LICENSE.md","_id":"@desert-ant-labs/ear@3.4.0","maintainers":[{"name":"finnvoorhees","email":"finn@detail.co"},{"name":"laurierrochon","email":"laurier@detail.co"},{"name":"pveugen","email":"paul@pave4.com"},{"name":"akagabi","email":"gabesuit@gmail.com"}],"homepage":"https://desertant.com/models/ear/","bugs":{"url":"https://github.com/Desert-Ant-Labs/desert-ant-core/issues"},"dist":{"shasum":"2e564f6c478ac5717799243ae7ddb68f906777a8","tarball":"https://registry.npmjs.org/@desert-ant-labs/ear/-/ear-3.4.0.tgz","fileCount":31,"integrity":"sha512-EGl+Y1lzjum0EsIpJ+EL0CmRZlTImMIIjwH/6zlZ/hwLx6BeF/8xiL+lJ/Y0SMY/rgikdSQGiYxAnMtIKtzIRA==","signatures":[{"sig":"MEUCIDejOJKL++7jc1EFlgzuFYQ/AY8PJdLpoMrJirSsxb06AiEAqu6iwnO+s3DJsFE4DlZi8SPWedFAykhphll7SSrKZBc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCICiuoTsJCYPXtAnHv+dR0nFpCspBONRD5NeBCJWNia/qAiB4bn8Sv7u7v5jpCG+RQeFFWyXeAalhO2lKqrYR7HmiFA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":173862656},"main":"./browser.js","type":"module","types":"./index.d.ts","browser":"./browser.js","exports":{".":{"types":"./index.d.ts","default":"./browser.js"},"./wasm":"./dist/EarWeb.wasm","./native":{"types":"./index.d.ts","default":"./node.js"},"./browser":{"types":"./index.d.ts","default":"./browser.js"}},"gitHead":"2ac655305628a4d1489387c87675e044b715583a","imports":{"#platform":{"browser":"./platform-browser.js","default":"./platform-node.js"}},"scripts":{"test":"DAL_USAGE_DISABLED=1 node --test test/ear.test.mjs"},"_npmUser":{"name":"akagabi","email":"gabesuit@gmail.com"},"repository":{"url":"git+https://github.com/Desert-Ant-Labs/desert-ant-core.git","type":"git","directory":"packages/ear-node"},"_npmVersion":"10.9.8","description":"On-device spoken language identification for JavaScript: name the language of a recording before you transcribe it. Runs in the browser (WebAssembly + LiteRT.js) and server-side in Node (native), from one import.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@desert-ant-labs/core":"^3.4.0","@bjorn3/browser_wasi_shim":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@litertjs/core":"^2.5.2"},"peerDependencies":{"@litertjs/core":">=2.1.0"},"optionalDependencies":{"koffi":"^2.9.0"},"peerDependenciesMeta":{"@litertjs/core":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ear_3.4.0_1790183555667_0.9982754380379926","host":"s3://npm-registry-packages-npm-production"}},"3.5.0":{"_id":"@desert-ant-labs/ear@3.5.0","bugs":{"url":"https://github.com/Desert-Ant-Labs/desert-ant-core/issues"},"dist":{"shasum":"a53bc54ada2f06543091cabf7a17c267fb9245d7","tarball":"https://registry.npmjs.org/@desert-ant-labs/ear/-/ear-3.5.0.tgz","fileCount":31,"integrity":"sha512-/akm67bdOuCaF0gojtLvgGvD5gPRlV2t8w96YwzHcqlUY0BCdu7++VhLW0LQXAoQZmkGW53TH7uXcs/ePKNhfA==","signatures":[{"sig":"MEYCIQDPXFC9XHYf1+xlXBN9eVsWFYNkZoRVNxJXqhsE7aUGGAIhANM5WOxNTgNvNXUk9aYS7x8O/kGksrdcu2YwZttFvfSg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDjwGoWgKKZ0p5O9VrBc43QLLbK1HDm9EkqoRrIIpquOAiBFdV2bP+iB46TLcSryXz1hUohyAzJuZG1bRcvj1UZ7dw=="}],"unpackedSize":174016276},"main":"./browser.js","name":"@desert-ant-labs/ear","type":"module","types":"./index.d.ts","browser":"./browser.js","exports":{".":{"types":"./index.d.ts","default":"./browser.js"},"./wasm":"./dist/EarWeb.wasm","./native":{"types":"./index.d.ts","default":"./node.js"},"./browser":{"types":"./index.d.ts","default":"./browser.js"}},"gitHead":"ec1f2895369d072a8a16baa1ef0761862d4c87cf","imports":{"#platform":{"browser":"./platform-browser.js","default":"./platform-node.js"}},"license":"SEE LICENSE IN LICENSE.md","scripts":{"test":"DAL_USAGE_DISABLED=1 node --test test/ear.test.mjs"},"version":"3.5.0","_npmUser":{"name":"akagabi","email":"gabesuit@gmail.com"},"homepage":"https://desertant.com/models/ear/","keywords":["language-identification","language-detection","langid","spoken-language","speech","audio","on-device","wasm","litert","isomorphic"],"repository":{"url":"git+https://github.com/Desert-Ant-Labs/desert-ant-core.git","type":"git","directory":"packages/ear-node"},"_npmVersion":"10.9.9","description":"On-device spoken language identification for JavaScript: name the language of a recording before you transcribe it. Runs in the browser (WebAssembly + LiteRT.js) and server-side in Node (native), from one import.","directories":{},"maintainers":[{"name":"finnvoorhees","email":"finn@detail.co"},{"name":"laurierrochon","email":"laurier@detail.co"},{"name":"pveugen","email":"paul@pave4.com"},{"name":"akagabi","email":"gabesuit@gmail.com"}],"_nodeVersion":"22.23.3","dependencies":{"@desert-ant-labs/core":"^3.5.0","@bjorn3/browser_wasi_shim":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@litertjs/core":"^2.5.2"},"peerDependencies":{"@litertjs/core":">=2.1.0"},"optionalDependencies":{"koffi":"^2.9.0"},"peerDependenciesMeta":{"@litertjs/core":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ear_3.5.0_1790215517037_0.05887562311692274"}}},"time":{"created":"2026-08-28T15:35:52.029Z","modified":"2026-09-24T02:05:18.168Z","3.1.0":"2026-08-28T15:35:53.423Z","3.2.0":"2026-09-18T12:20:59.245Z","3.3.0":"2026-09-21T23:04:21.928Z","3.3.1":"2026-09-23T01:13:18.417Z","3.4.0":"2026-09-23T17:12:36.571Z","3.5.0":"2026-09-24T02:05:17.969Z"},"bugs":{"url":"https://github.com/Desert-Ant-Labs/desert-ant-core/issues"},"license":"SEE LICENSE IN LICENSE.md","homepage":"https://desertant.com/models/ear/","keywords":["language-identification","language-detection","langid","spoken-language","speech","audio","on-device","wasm","litert","isomorphic"],"repository":{"url":"git+https://github.com/Desert-Ant-Labs/desert-ant-core.git","type":"git","directory":"packages/ear-node"},"description":"On-device spoken language identification for JavaScript: name the language of a recording before you transcribe it. Runs in the browser (WebAssembly + LiteRT.js) and server-side in Node (native), from one import.","maintainers":[{"name":"finnvoorhees","email":"finn@detail.co"},{"name":"laurierrochon","email":"laurier@detail.co"},{"name":"pveugen","email":"paul@pave4.com"},{"name":"akagabi","email":"gabesuit@gmail.com"}],"readme":"# @desert-ant-labs/ear\n\nOn-device spoken language identification for JavaScript. Takes a recording and\nnames the language it is in, so an app can pick the right recognizer before it\nstarts transcribing. Everything runs locally, so the audio never leaves the\ndevice or browser.\n\nTwo entries share one `Ear` API:\n\n- **`@desert-ant-labs/ear`** (default): a WebAssembly pipeline with\n  [LiteRT.js](https://www.npmjs.com/package/@litertjs/core) inference\n  (XNNPACK-accelerated CPU by default, optional WebGPU), for the **browser**. It\n  has no native dependencies, so a single import builds cleanly for every target\n  of a multi-target bundler (Next.js, Remix, SvelteKit, Nuxt), including the\n  browser bundle and the Client-Component SSR pass those frameworks render in\n  Node. It is safe to *import* during server-side rendering, but LiteRT.js needs\n  a browser (or Web Worker) to initialize, so `Ear.load()` runs inference only in\n  the browser; calling it in plain Node throws an actionable error pointing you\n  to `/native`.\n- **`@desert-ant-labs/ear/native`**: a prebuilt native core (LiteRT on Linux,\n  Core ML on macOS), for **server-side inference** in Node. No `@litertjs/core`,\n  no build tools, no flags. Import it from server-only code (API routes, server\n  actions, plain Node scripts). Do not import it from a component that also\n  renders in the browser.\n\n```bash\n# Browser (default entry):\nnpm i @desert-ant-labs/ear @litertjs/core\n\n# Server-side inference in Node (/native entry) needs no extra install:\nnpm i @desert-ant-labs/ear\n```\n\n## Use\n\n```js\nimport { Ear } from \"@desert-ant-labs/ear\";          // browser\n// import { Ear } from \"@desert-ant-labs/ear/native\"; // Node\n\nconst ear = await Ear.load();                        // downloads once, then cached\nconst detection = await ear.identify(samples, 16000);\n\ndetection.language      // \"pt\"\ndetection.confidence    // 0.98\ndetection.isReliable    // true\n\near.dispose();\n```\n\n`samples` is mono `Float32Array` at any rate; audio is resampled, and 16 kHz\navoids the conversion.\n\n## Branch on `isReliable`, not on `confidence`\n\n```js\nif (detection.isReliable) {\n  transcribeWith(detection.language);\n} else {\n  askTheUser();            // or fall back to a general recognizer\n}\n```\n\n`isReliable` is false when the top two candidates are too close to separate, and\nfalse for the Nordic languages, which the model confuses with each other\nconfidently rather than uncertainly - so their probability does not reveal the\nproblem and a threshold on `confidence` cannot catch it. The flag is decided in\nthe model and crosses the boundary as a number, so every SDK reads the same\nverdict.\n\nThe threshold behind it was set by sweeping it against 162 recordings: of the\nanswers above it, 98.5% route correctly, and on files in a language the primary\nrecognizer supports, 100% do.\n\n## What it listens to\n\nA file handed to a transcriber is not speech end to end, so `Ear` does not\nlisten to it end to end either. It ranks candidate windows by how much of their\nloudness varies at syllable rate - speech rises and falls three to six times a\nsecond and has gaps between words, music sustains, silence does not vary at all\n- and listens to the three most speech-like.\n\nPass `windows` to change how many:\n\n```js\nawait ear.identify(samples, 16000, { windows: 5 });\n```\n\n## Limits\n\n- **Speech mixed under louder music** is read correctly about 60% of the time.\n  Choosing better windows does not help; the model cannot read it.\n- **Nordic languages** are not distinguished reliably, and `isReliable` is false\n  for all of them rather than reporting one confidently.\n- **Recordings shorter than thirty seconds** get a single window, so there is\n  nothing to average and the answer is less certain than the number suggests.\n- Multilingual recordings are reported as whichever language the chosen windows\n  contain, not as a mixture.\n\n## Licence\n\nSee LICENSE.md. The weights are published separately at\n[`desert-ant-labs/ear`](https://huggingface.co/desert-ant-labs/ear) and derive\nfrom `openai/whisper-tiny` (MIT), attributed there.\n","readmeFilename":"README.md"}