DEV Community

prateek khandelwal
prateek khandelwal

Posted on

How I Built a 100% Client-Side Video-to-MP3 Converter with WebAssembly

Every developer has faced this annoyance: you have a 1GB meeting recording, podcast video, or screen capture, and you just want the 15MB MP3 audio track.

If you search for an online converter, you’re forced into the same frustrating loop:

  1. Upload hundreds of megabytes over your bandwidth.
  2. Wait in a remote server processing queue.
  3. Trust a third-party server with your unencrypted video files.
  4. Deal with aggressive popups and ad redirects.

I decided to fix this by building AIConverterLab β€” an in-browser media converter where all transcoding runs directly on your machine's CPU/GPU via WebAssembly (WASM).


πŸ›  How It Works Under the Hood

The architecture runs without backend processing servers:

  1. FFmpeg in WebAssembly:

    Instead of piping data to a remote Linux worker, the web app boots FFmpeg compiled into a WebAssembly module inside a dedicated browser Web Worker. This keeps the UI completely smooth and non-blocking during heavy transcoding.

  2. Zero-Knowledge File Handling:

    When you drop an MP4, MOV, or WebM file into the dropzone:

    • The file is read locally using the HTML5 File API as an ArrayBuffer.
    • The memory buffer is passed straight into the WASM virtual file system (FS.writeFile).
    • The audio stream is extracted directly into MP3 (with support up to 320 kbps).
    • The output is returned as an in-memory Blob URL.

Zero bytes ever touch a cloud server. You can literally disconnect your Wi-Fi after loading the page and the conversion will still succeed.

  1. Canvas Audio Waveform & Player: Once the audio is extracted, an HTML5 <canvas> decodes the audio buffer to render a visual waveform scrubber so users can preview and verify their audio before downloading.

πŸš€ Key Features

  • No Arbitrary File Size Limits: You aren't capped by 100MB cloud free-tiers.
  • Audio Tuning: Configurable bitrate (128k, 192k, 256k, 320k), custom sample rates, volume boosting, and trimming.
  • Lightweight Vanilla Stack: Built without heavy SPA framework bloat so it loads instantly.

πŸ§ͺ Try It Out & Share Your Feedback

I would love to hear feedback from the DEV community:

  • How does WASM transcoding speed perform on your machine?
  • Any specific audio/video containers you'd like supported next?

πŸ‘‰ Live App: https://aiconverterlab.com

Top comments (0)