
Draw a waveform image
Draw an audio file's (or a video's audio track's) peaks as a PNG, one column per pixel of width, decoded through the same PCM path as audio-reverse and drawn straight into a pixel buffer, the way font-preview rasterizes glyphs, with no canvas. WAV decodes everywhere; other codecs need a browser.
Draw a waveform image turns a clip's peaks into a PNG, one bar per pixel of width, at 800 by 200 pixels by default in a colour you pick. Decoded PCM samples go directly into a bitmap, skipping any canvas API. WAV opens in Node and the browser; every other codec needs a browser tab first.
Questions
What determines the shape drawn?
For every pixel column, the tool finds the minimum and maximum peak sample within that slice of time and draws a vertical bar between them, the standard peaks style of waveform.
Can I change the size or colour?
Yes. width and height default to 800 by 200 pixels, and color takes a 6 digit hex code like #3b82f6, the default blue used here.
Why is there no canvas involved?
Because the pixel buffer is written directly, the same rasterizing approach font-preview uses for glyphs, so this can run without OffscreenCanvas.
Does it work on a video file?
Yes, on its audio track. Only the audio is decoded and drawn; the video picture itself is not read.
What image format do I get?
Always PNG, named after your source file with -waveform.png on the end.