# Handling Voice | AudioDN Examples

> Capture voice from the mic or upload recordings, store speech as a tiny Opus variant, drop the original, and play back only what listeners need.

Source: https://audiodeliverynetwork.com/examples/handling-voice/

---

# Handling Voice

Voice products — voicemail, support calls, IVR prompts, narration, voice notes — need a path from capture to cheap storage to playback. AudioDN covers the full loop: record or upload speech, mint a speech-tuned **Opus** variant, drop the bulky original, and stream only the tiny archive listeners need.

Opus is built for speech and low-bitrate streaming. At 32 kbps mono it often sounds clearer than much larger MP3/AAC encodes of the same voicemail — and your storage curve collapses once you remove the original WAV.

## Get voice in

Two common paths land speech in AudioDN. Prefer the highest quality you have at capture time so the Opus encode starts from a clean signal — then let AudioDN handle the rest.

### Record in the browser

The `<audiodn-recorder>` web component captures from the microphone, shows a live waveform and preview, then uploads a single track. The browser prefers Opus in WebM/Ogg when available (MP4/AAC on Safari), so the upload itself is already speech-friendly. Use a Client-Side Upload key, or pass a server-created upload session.

Full attributes, events, and themes: [Recorder component docs](/docs/components/recorder).

### Live demo

Tap to record, preview the clip, then send it. Requires microphone permission.

Record from your microphone, preview, then upload a single voice track to AudioDN.

### Upload an existing recording

Phone apps, Zoom exports, cheap recorders, and studio WAVs can all land in the same collection. Upload via the [Uploader component](/docs/components/uploader) or the [Upload Sessions API](/docs/api/upload-sessions) — create a session, create a track, PUT the bytes, then wait until `track_status_id` is `ready` (or listen for a track webhook) before playback.

## Why Opus for voice

Speech is usually mono with narrow dynamics. Keeping a multi-megabyte WAV (or a music-oriented HQ AAC) forever burns storage and bandwidth for almost no perceptual gain. A dedicated speech Opus variant (this example names it `voice`) gives every upload a predictable, speech-tuned file you can hand to players, download endpoints, or cold storage.

| Stage | Typical footprint (~45s mono) | Notes |
| --- | --- | --- |
| Source WAV (48 kHz / 16-bit) | ~4 MB | Lossless capture |
| Opus `voice` @ 32 kbps mono | ~180 KB | Clear speech; ideal for voicemail & IVR-scale libraries |
| Opus `voice` @ 64 kbps mono | ~360 KB | Extra headroom for noisy lines or thicker accents |

That is roughly a **20×–40×** shrink versus the source WAV before you delete the original. At library scale — thousands of messages — you move from “keep everything forever” to “keep what listeners actually play.”

## Transcode to a voice Opus variant

There is no built-in variant called `voice` — that is just the `index` name we chose for this example account. Configure a `transcode` variant with `codec: “opus”` and give it any unique index you like (`voice`, `speech`, `vm`, …). For speech, start at **32 kbps mono** — dramatically smaller than music presets, still intelligible on earbuds and handsets. Bump to **64 kbps** when you need more fidelity for noisy sources. Strip tags and cover art; they only waste bytes on voicemail.

Set the recipe once in the [dashboard](https://account.audiodeliverynetwork.com/variants) so every upload gets that named file automatically, or append it to a ready track with the Variants API. The `index` must be unique — pick one bitrate recipe per index.

Field reference: [Variants API](/docs/api/variants). Variant type overview: [Variant Types](/docs/variant-types).

## Drop the original when you are happy

While you are still tuning recipes, keep the Original Upload so you can regenerate variants. Once `voice` sounds right and you no longer need re-processing, delete the original to reclaim the big WAV (or other source) from storage. After that, AudioDN cannot mint new variants for that track — only the remaining files (like `voice`) stay available for playback and download.

Trade-off details: [Original Upload](/docs/variant-types#original-upload). Pattern for voicemail / archival products: upload high quality → wait for `voice` → delete original → deliver only `variants=“voice”` forever.

## Play only the voice variant

Point the player at the track and request your speech Opus variant by the index you configured — here `variants=“voice”` — with a Client-Side Player key. Listeners never download the multi-megabyte source — just the Opus file you decided to keep.

#### Dependency

 

```
npm install @audiodn/components
```

```
<script type="module" src="https://unpkg.com/@audiodn/components@latest/dist/player.js"></script>
```

#### Usage

```
<script type="module">
  import '@audiodn/components/player';
</script>

<audiodn-player
  api-key="YOUR_PLAYER_API_KEY"
  scope="track"
  id="TRACK_ID"
  variants="voice"
  size="regular"
></audiodn-player>
```

### Live demo

This player requests `variants=“voice”` — the index of a speech-tuned Opus variant added to this demo account (you could name yours anything). The track is an answering-machine sample; hear the footprint you get to ship.

Demo voicemail — generated sample for this example (answering-machine beep + message).

More player options: [Player component docs](/docs/components/player).

## Checklist

-   Voice lands in AudioDN — via [<audiodn-recorder>](/docs/components/recorder), the [Uploader](/docs/components/uploader), or the [Upload Sessions API](/docs/api/upload-sessions).
    
-   A speech-tuned Opus transcode exists under whatever index you chose (this example uses `voice`), mono, and 32 (or 64) kbps — see [Variants API](/docs/api/variants).
    
-   Listen to that variant by index and confirm speech quality is good enough for your product.
-   Delete the Original Upload when you no longer need to regenerate variants — keep only the cheap Opus archive.
    

Published July 22, 2026
