audio/ui
Toggle Mode D
Copy to Clipboardpnpm dlx shadcn@latest add @audio-ui/engine-repair
Copy to Clipboardimport { REPAIRS, repairChannels } from "@/lib/engine/repair";
| Used by | sound-operations |
|---|---|
| audio.js | @audio/denoise |
| Export | Kind | What it is |
|---|---|---|
REPAIRS | const | The defects of a recording that can be taken out of it, each by the method made for it: clean finds what the sound carries and picks the method itself; clicks and crackle rebuild impulses from the sound around them (vinyl ticks, mouth clicks, shellac); hum50 and hum60 take out the mains hum and its harmonics; noise and speechNoise take out steady broadband noise, and noise that changes under a voice; clipping rebuilds peaks cut at full scale; wind and plosives take out low rumble and the bursts of p and b; breaths and reverb take down the breaths between phrases and a room's late reverb. |
Repair | type | |
repairChannels | function | Every channel with one defect taken out, by the method made for it, each channel on its own. |
Usage
repairChannels takes channels, their sample rate and one repair of REPAIRS, and gives back channels of the same length with that defect taken out. Each channel is processed on its own, the source is left as it is, and a sound with no such defect comes back as it was.
Copy to Clipboardimport { REPAIRS, repairChannels } from "@/lib/engine/repair"; repairChannels(channels, 48_000, "hum60"); // mains hum and its harmonics at 60 Hz repairChannels(channels, 48_000, "clean"); // finds what the sound carries and picks the method
| Repair | Takes out |
|---|---|
clean | What the sound carries, found by the library |
clicks, crackle | Impulses (vinyl ticks, mouth clicks, splices) and dense ones (shellac), rebuilt from the sound around them |
hum50, hum60 | Mains hum and its harmonics |
noise, speechNoise | Steady broadband noise, and noise that changes under a voice |
clipping | Peaks cut at full scale, rebuilt |
wind, plosives | Low rumble, and the bursts of p and b |
breaths, reverb | Breaths between phrases, and a room's late reverb |
The registry's sound-operations names them as operations of the Process menu, which the audio editor bakes as steps of undo through useBake and the clip panel runs on a clip's source.