WAV to MP3 encoder

Convert a WAV recording to a constant-bitrate MP3 locally in your browser, using LAME 3.101 compiled to a QIP component. The audio is not uploaded to a server.

The component accepts WAV files up to 1008 MiB: about 100 minutes of 44.1 kHz stereo, 90 minutes of 48 kHz stereo, or over three hours of mono. It encodes at a constant bitrate with LAME's -q 2 quality setting and writes no ID3 or Xing header. At low bitrates LAME lowers the sample rate: 44.1 kHz stereo becomes 32 kHz at 96 kbps, 24 kHz at 64 kbps and 16 kHz at 32 kbps. For speech, a mono WAV keeps more detail at the same bitrate than a stereo one. Input below 32 kHz keeps its sample rate and is encoded as MPEG-2, whose bitrates top out at 160 kbps, so higher choices are capped there. On the CLI, bitrate_kbps rounds to the nearest MP3 bitrate from 32 to 320 kbps, for example 100 becomes 96, and applies to one encode only.

The encoder is LAME, licensed under the LGPL v2. Its unmodified source and the wrapper that builds this component are in the QIP repository under third_party/lame-3.101 and audio/wav/wav-to-mp3-lossy.c.

Components #

Browse all audio components.

CLI equivalent #

qip run audio/wav/wav-to-mp3-lossy.wasm -u bitrate_kbps=192 \
  < input.wav > output.mp3