Convert audio files between formats like MP3 and WAV locally for compatibility.
In the past, converting audio required uploading a file to a remote server, where a tool like FFmpeg would transcode it, and then you would download the result. This was slow, expensive to host, and terrible for privacy.
This tool performs the conversion entirely within your browser using the Web Audio API combined with WebAssembly (WASM).
When you play a sound in the browser, it uses a standard AudioContext. This processes audio in real-time, perfectly synced to your computer's audio hardware clock so you hear it smoothly.
For converting files, we use an OfflineAudioContext. Instead of sending the audio to your speakers, it renders the audio graph as fast as your CPU can handle—often much faster than real-time—and outputs it directly into a raw AudioBuffer in memory.
Once we have this raw, uncompressed PCM (Pulse-Code Modulation) buffer, we pass it to an encoder (like LAME for MP3) that has been compiled to WebAssembly.
The WebAssembly encoder runs at near-native C++ speeds directly on your device, compressing the raw data back down into the requested format without ever sending a single byte over the network.
What is the primary difference between a standard AudioContext and an OfflineAudioContext?