open-index/open-npm huggingface dataset:
npm package: @pmate/mic
Description: Reusable PMate microphone recorder components and hooks
Latest version: 0.2.0

# `@pmate/mic`

Reusable PMate microphone recording primitives for React apps.

## What it includes

- `MicRecorderButton`
- `MicStateManage`
- `Recorder`

The package records mono PCM audio through an AudioWorklet at `16kHz`, which matches the current PMate ASR demo path.

## Install

```bash
npm install @pmate/mic
```

## Example

```tsx
import { MicRecorderButton } from "@pmate/mic"

export function Demo() {
  return (
    <MicRecorderButton
      onFinish={(blob) => {
        console.log("recorded blob", blob)
      }}
      onError={(error) => {
        console.error(error)
      }}
    />
  )
}
```

## Notes

- The package is UI-light on purpose. Apps can style around it or wrap it.
- ASR transport is intentionally not built into the package. Callers own upload or streaming behavior.