1. Reference
  2. Media

<mic>

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

Media Uses microphone

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

mic.ham
<column style="gap-8 w-full">
    <text style="font-bold">Voice memo</text>
    <mic id="memo"
         color="red"
         max-duration="60"/>
</column>
The snippet drawn by Hype Apps on a phone, in light mode The snippet drawn by Hype Apps on a phone, in dark mode
This snippet as Hype Apps draws it on a phone. It follows this page's light or dark theme.

Attributes

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

Commands

NameWhat 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

NameWhat 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.

This page is also Markdown, and all of HAM is in llms.txt.