# <mic>

A voice recorder with a record button, a live waveform, a timer and playback of the last take.

Category: Media. Uses microphone.

This tag needs a microphone, so try it on your phone.

```ham
<column style="gap-8 w-full">
    <text style="font-bold">Voice memo</text>
    <mic id="memo"
         color="red"
         max-duration="60"/>
</column>
```

How Hype Apps draws it on a phone: [light](https://hypeapps.dev/img/tags/mic-light.webp), [dark](https://hypeapps.dev/img/tags/mic-dark.webp).

## Attributes

| Name | What it does | Default |
|---|---|---|
| `color` | Accent color for the record button and waveform. |  |
| `controls` | Built-in record/playback bar; false to compose your own from commands. | `true` |
| `format` | wav (default), opus or flac; any other value records AAC-LC. | `wav` |
| `max-duration` | Auto-stop after N seconds. |  |
| `playback` | Playback controls for the last take. | `true` |
| `speed` | Playback-speed control. | `false` |
| `timer` | Elapsed-time readout. | `true` |
| `volume` | Volume control. | `false` |
| `waveform` | Live waveform while recording. | `true` |

## Commands

| Name | What it does |
|---|---|
| `effect` | Post-process the last take (WAV only, not on web): reverse, speed, pitch, chipmunk, deep, echo, reverb, bass, treble, distortion, telephone, robot, whisper, fadein, fadeout, normalize, volume; reset/original restores it. |
| `pause` | Pause the recording, else playback. |
| `play` | Play the last take. |
| `record` | Start recording. |
| `resume` | Resume a paused recording, otherwise start playback. |
| `speed` | Playback rate. |
| `stop` | Stop the recording if one is running, otherwise stop playback. |
| `toggle` | Record ↔ stop. |
| `volume` | Playback volume 0.0–1.0. |

## Readings

| Name | What it does |
|---|---|
| `duration` | The recording's length in whole seconds. |
| `path` | The last recording's path. |
| `paused` | Whether a recording is paused. |
| `playing` | Whether the recording is playing back. |
| `recording` | Whether it is recording. |

Any tag also takes gestures: `@on.tap`, `@on.longpress`, `@on.doubletap` and `@on.swipeleft` (and right, up and down). `@click` runs on a tap too.

## Related tags

- [`<column>`](https://hypeapps.dev/docs/reference/column.md): Stacks its children top to bottom, with a gap between them and an alignment across.
- [`<text>`](https://hypeapps.dev/docs/reference/text.md): A run of text; with @text it shows an expression that updates as its variables change.
- [`<audio>`](https://hypeapps.dev/docs/reference/audio.md): A compact audio player bar with play, a progress track and the track's title and artist.
- [`<camera>`](https://hypeapps.dev/docs/reference/camera.md): A live camera viewfinder with a shutter; the photo's path goes into a variable.
- [`<canvas>`](https://hypeapps.dev/docs/reference/canvas.md): A drawing surface for finger or stylus, with a pen, eraser and color toolbar; it saves as a PNG.
- [`<file-picker>`](https://hypeapps.dev/docs/reference/file-picker.md): Opens the device's photo, video or file picker (or the camera) and puts the chosen file in a variable.
- [`<img>`](https://hypeapps.dev/docs/reference/img.md): Shows a picture from a URL or the app's files, sized and cropped by its style.
- [`<layer>`](https://hypeapps.dev/docs/reference/layer.md): Declares one layer of a drawing surface: a locked picture to trace over, and a layer to paint on.

All tags: https://hypeapps.dev/docs/reference.md · The full reference: https://hypeapps.dev/llms.txt
