Create an audio waveform SVG with one background rectangle and one vertical minimum-to-maximum line for every peak column, using fixed pixel dimensions and a matching viewBox.

The Audio Waveform Generator creates that output by decoding one selected file in the current browser tab, calculating a bounded peak envelope, and generating SVG text locally. Neither the audio file nor the graphic is uploaded to Lizely, and the source recording is never rewritten.

create audio waveform
Create an Audio Waveform SVG: Lines, Colors, and Layers

The lines, colors, and background layer

The generated file has a deliberately simple structure: one background rectangle followed by a group of vertical peak lines. Time runs from left to right, and each line spans the minimum and maximum sample values found in one bucket of decoded audio frames. This makes the result a time-domain amplitude overview rather than a representation of the recording’s frequency content.

Representation What it communicates What it does not communicate
Peak envelope The minimum-to-maximum sample range across successive time buckets Frequency content, notes, beats, loudness, transients, speech, or musical structure
Combined stereo or multichannel view One overview calculated from extrema across all decoded channels Separate channel lanes, preserved channel identity, or an averaged audio signal
Static SVG output A background, vector peak lines, fixed dimensions, and a matching viewBox PNG, JPEG, video, audio, animation, or a calibrated loudness measurement

That distinction matters when choosing an analysis method. Compare the waveform generator with a spectrogram and other analyzers before treating the image as frequency data or a mastering diagnostic.

Audio files and limits to check first

The browser can read MP3, WAV, M4A, AAC, Ogg, WebM, and FLAC files when the current browser and operating system support their actual codecs. A familiar extension or MIME label cannot guarantee that decoding will succeed. The browser decodes the selected media into Web Audio’s AudioBuffer data before the generator calculates its peak envelope.

Input check Required limit
Compressed file size At most 50 MiB
Decoded duration No more than five minutes
Decoded channel count One through eight channels
Decoded sample rate 8,000 through 192,000 Hz
Total decoded channel samples No more than 30 million

Over-limit audio is rejected as a whole rather than silently reduced to its opening section. Unsupported, corrupt, empty, or disguised files also produce an error instead of a partial waveform. These checks matter because a compact compressed recording can decode into a much larger collection of floating-point channel samples.

Create the waveform SVG

Follow the complete workflow from the selected file through the inspectable SVG download:

  1. Choose one browser-decodable audio file. Open the generator and select a supported MP3, WAV, M4A, AAC, Ogg, WebM, or FLAC file. Confirm that it satisfies the compressed-size, duration, channel, sample-rate, and channel-sample limits before continuing.
  2. Set the SVG dimensions and colors. Choose a width from 320 through 1,600 pixels and a height from 120 through 600 pixels. Set the background and waveform colors with the browser’s six-digit hexadecimal controls. These settings determine the final SVG geometry rather than merely resizing a preview.
  3. Generate the local peak envelope. Run the generation step. The current file is decoded in the browser tab, its sample frames are divided into equal index ranges, and the tool calculates a bounded minimum and maximum for each range.
  4. Check the reported frame and column counts. Confirm the decoded frame count and peak-column count shown by the generator. The expected column count is the smaller of the requested image width, 1,000, and the decoded frame count, so a short recording does not gain invented measurements.
  5. Inspect the preview and SVG text. Review the rendered waveform for the expected overall pattern, then open the expandable inspector to examine the generated SVG. Check the fixed dimensions, matching viewBox, background color, waveform color, and peak-line group in the exact text that will be downloaded.
  6. Download the exact SVG. Save the text-based vector file. The download uses the identical string shown in the inspector, contains one background rectangle and a group of peak lines, and remains sharp when displayed at another size. It is not a PNG, JPEG, video, animation, or audio export.

How peak-column geometry is calculated

The decoded sample frames are divided into contiguous, equal integer-index ranges. The first range begins at frame zero, the final range reaches the last decoded frame, and adjacent ranges do not leave accepted frames out. Bucket boundaries are derived from the bucket number and total frame count, which keeps the SVG geometry deterministic.

For each range, the generator finds the minimum and maximum finite sample across every decoded channel. Defensively out-of-range values are clamped to the interval from -1 through 1. It then draws one vertical SVG line from that bucket’s maximum to its minimum. Using both extrema preserves short positive and negative peaks that a single arbitrary sample in each bucket could miss.

The vertical center sits at half the requested height. A full-scale positive or negative sample extends to 45 percent of the height above or below that center, leaving a five-percent margin at the top and bottom. Columns are evenly centered across the requested width, so changing the dimensions changes the SVG coordinates consistently rather than stretching a pre-rendered bitmap.

For stereo and multichannel files, every bucket combines all decoded channels. Its minimum may come from one channel and its maximum from another, which is why the tool does not display separate left and right lanes. It does not average the channels into a new signal or preserve channel identity visually. If separate channel waveforms are required, use an audio editor that exposes each channel as its own track.

Verify the output before using it

The generator provides several independent ways to check the result before it enters a design or editing workflow. If the preview and reported counts do not agree, fix a waveform output that looks wrong before continuing.

  • Compare the counts: Confirm that the SVG contains the reported number of peak columns and that the column count follows the width, 1,000-column, and decoded-frame limits.
  • Check the geometry: Verify that the SVG’s pixel width and height match the selected controls and that its viewBox represents the same drawing area.
  • Check the colors: Confirm that the background and waveform use the selected six-digit hexadecimal values. The generator builds the markup from validated colors rather than taking them from filenames or embedded source metadata.
  • Confirm the current input: Make sure the preview corresponds to the selected file and current settings. Selecting a replacement, changing an option, generating again, or leaving the page revokes the obsolete object URL so an earlier image cannot appear to represent newer inputs.
  • Inspect the delivered string: The SVG shown in the expandable inspector and the downloaded file are the same content, which makes the output suitable for inspection, SVG-aware editing, and a reproducible handoff.

Use the SVG with the right expectations

A static SVG is useful for web layouts, editorial graphics, vector compositions, and projects that require an editable vector file. Its fixed dimensions make placement predictable, while the matching viewBox allows the graphic to remain sharp at another display size. Extremely large print or editing workflows may still require different stroke widths or more detailed source data.

The output does not animate with playback and does not react to live audio. It is a static overview derived from one decoded recording. The original file remains available in its original form because the generator does not rewrite or export the audio.

Finally, a peak waveform is not a calibrated loudness meter. Two recordings can show similar peaks while sounding very different because perceived loudness also depends on duration, frequency balance, dynamics, and playback conditions. Do not use this picture to diagnose hearing, equipment problems, clipping history, phase, or mastering compliance; those questions require measurements outside this simple peak-envelope method.