npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@evluic/asr-client

v0.4.0

Published

Headless browser client for the EVL ASR proxy: live microphone speech-to-text with speaker diarization, as events.

Readme

@evluic/asr-client

Headless browser client for an EVL ASR proxy (renambot/ASR): live microphone speech-to-text with optional speaker diarization, delivered as events. No DOM, no CSS, no framework, no dependencies — you build the UI.

The heavy lifting (NVIDIA NIM/Riva session, reconnection, API keys, background LLM analyzers) lives in the proxy; this client captures the mic, streams 16 kHz PCM over a WebSocket, and hands you transcript events.

Install / load

From npm:

npm install @evluic/asr-client

Classic script (sets window.AsrClient; also served by the proxy at /sdk/asr-client.js, or use the minified dist/asr-client.min.js):

<script src="https://your-proxy-host/speech/sdk/asr-client.js"></script>

ES modules / bundlers (TypeScript definitions included):

import AsrClient from "@evluic/asr-client";   // dist/asr-client.mjs

CommonJS: const AsrClient = require("@evluic/asr-client");

To rebuild dist/ after editing the source: npm install && npm run build (esbuild; the src/ file itself needs no build step).

Quick start

// Pick a microphone (optional — omit deviceId for the system default).
// Note: browsers only reveal device labels after a mic permission grant.
const mics = await AsrClient.listMicrophones();   // [{deviceId, label}]

const asr = new AsrClient({
  serverUrl: "https://your-proxy-host/speech",  // "" if served by the proxy itself
  deviceId: mics[0].deviceId,
  diarization: true,
  maxSpeakers: 3,
});

asr.on("interim", (text) => hypothesisEl.textContent = text);
asr.on("segment", (seg) => addLine(asr.speakerLabel(seg.speaker), seg.text));
asr.on("status", (state) => console.log("ASR:", state));

await asr.start();     // asks for mic permission, starts streaming
// ... later:
asr.pause();           // stop sending audio, keep the session open
asr.resume();
await asr.stop();      // flush, let end-of-meeting analyzers run, tear down

// On-demand LLM calls over the transcript (work after stop() too):
const { result } = await asr.summarize();
const findings = await asr.analyze("List the action items as bullets");

// Switch mics between sessions:
asr.configure({ deviceId: mics[1].deviceId });    // applies on the next start()

Options (constructor / configure())

| Option | Default | Notes | |---|---|---| | serverUrl | (required) | Proxy base URL: "https://host/path", "/path", or "" (same origin) | | diarization | server default | Label speakers | | maxSpeakers | server default | 1–8, used when diarization is on | | punctuation | server default | Automatic punctuation | | deviceId | system default | From AsrClient.listMicrophones() | | echoCancellation | true | Mic processing | | noiseSuppression | true | Mic processing | | autoGain | false | Off by default: AGC distorts diarization cues | | reconnect | true | Auto-reconnect while running | | captureAudio | false | Keep streamed PCM so getWav() works (~10 min cap) | | workletUrl | inlined | Override if your CSP forbids blob: scripts | | analyzers | false | Opt in to the proxy's background analyzers (topics, summaries, …) for this session; results arrive as analysis events. Off by default so your page doesn't silently trigger server-side LLM calls |

ASR/mic options apply on the next start(). configure(partial) merges options.

Events (on(event, fn) → returns unsubscribe; off(event, fn))

| Event | Payload | Meaning | |---|---|---| | interim | text | Live hypothesis (replace-style) | | segment | {text, speaker, tMs} | Finalized segment; speaker is an id string or null | | speaker | id | A new speaker id appeared | | status | state, message? | idle · connecting · listening · paused · reconnecting · finalizing · full · error · closed | | analysis | {id, name, result\|error, ts} | Pushed by the proxy's background analyzers, if configured | | ai_running | boolean | A server-side LLM call is in flight | | error | Error | ASR error reported by the proxy |

Methods & properties

  • start() / pause() / resume() / stop() / dispose()stop({finalize: false}) skips the end-of-meeting analyzers and their wait (fast push-to-talk teardown; the tail is still transcribed)
  • setSpeakerName(id, name) — also syncs to the proxy so analyzers use it
  • speakerLabel(id) — custom name or "Speaker N"
  • transcriptText({timestamps, names}) — composed transcript; with timestamps: true each segment becomes [MM:SS] Label: text
  • clear({names}) — reset the transcript (and optionally the speaker names)
  • getWav()Blob of the streamed audio (captureAudio: true), else null
  • analyze(prompts, {text?}) — on-demand analysis via the proxy's stateless /analyze: a string, one {prompt, name?, chain?} object, or a list (chain: true feeds the previous prompt's output in as context). Defaults to this client's timestamped transcript; works during, paused, or after a session. Returns [{id, name, result|error}].
  • summarize({analyzer?, instruction?, text?}) — one-shot summary via /llm (the proxy's default prompt, a server-configured analyzer by name, or a custom instruction). Both methods fire the ai_running event and require an LLM configured on the proxy.
  • serverInfo() — the proxy's /config (defaults, LLM availability, sessions)
  • AsrClient.listMicrophones()[{deviceId, label}]
  • segments (read-only), interim, running, paused, elapsedMs, sampleRate, speakerNames

Notes

  • A proxy is required. Browsers can't talk to the NIM directly; deploy the ASR proxy from the main repo and point serverUrl at it.
  • Cross-origin embedding: set ALLOWED_ORIGINS on the proxy (e.g. ALLOWED_ORIGINS="https://app.example.com") to allow pages on other origins; it enables CORS on the HTTP API and an Origin check on the WebSocket.
  • stop() waits (bounded) for the proxy's end-of-meeting analyzers so their results arrive before the socket closes.

License: BSD-3-Clause.