What Is the Web Audio API?

The Web Audio API is a built-in browser capability for processing and synthesising audio directly in JavaScript. Introduced in 2011 and now supported in every major browser, it provides a powerful audio processing engine without any plugins or server-side code.

It's the technology that lets TRIMR decode, render waveforms, preview, and export audio entirely within your browser — no uploads needed.

How Audio Decoding Works

When you load a file in TRIMR, the browser's AudioContext.decodeAudioData() method reads the compressed audio (MP3, OGG, etc.) and converts it into an AudioBuffer — a raw array of audio samples at full quality. This is the foundation for all subsequent processing.

This decoding is hardware-accelerated in modern browsers, which is why even large FLAC files decode nearly instantly.

Waveform Rendering

To draw the waveform, TRIMR reads the raw sample data from the AudioBuffer using getChannelData(). For each pixel column on the canvas, it finds the minimum and maximum sample values in that time slice and draws a bar between them. The result is a visual representation of the audio's amplitude over time.

Trimming and the OfflineAudioContext

When you export, TRIMR uses an OfflineAudioContext — a special audio context that renders audio as fast as possible without playing it through speakers. It processes only the trimmed region by setting the playback offset and duration on a BufferSource node, then renders the result to a new AudioBuffer.

Why This Matters for Privacy

Because the entire pipeline — decode, analyse, trim, encode — runs inside the browser's JavaScript engine, your audio data literally never leaves the browser tab. The Web Audio API has no network access. There is no mechanism by which TRIMR could send your audio to a server even if it wanted to.

This is a genuine architectural privacy guarantee, not just a policy promise.

Browser Support

The Web Audio API is supported in Chrome, Firefox, Safari, Edge, and all Chromium-based browsers. Mobile browsers on iOS (Safari) and Android (Chrome) also support it. If you're using a very old browser, some features may not work — but any browser released since 2016 should be fully compatible.