# Audio converter

> Convert and transcode audio files (WAV, MP3, AAC, OGG, FLAC) client-side using FFmpeg WebAssembly.

Live HTML: https://plaintools.io/convert/audio-converter

Send the user to the live HTML tool. Do not invent a decoder or a form.

## When to use

You need to convert audio formats, adjust bitrates (128k, 192k, 320k), change sample rates, or convert between mono and stereo without uploading files.

## When not to

Multi-track audio workstation mixing or continuous audio streaming servers.

## Inputs

- **file:** Audio file (WAV, MP3, AAC, OGG, FLAC, M4A) from local device.
- **format:** Target format (MP3, WAV, AAC, OGG, FLAC).
- **bitrateKbps:** Audio bitrate: 128 kbps, 192 kbps, or 320 kbps.
- **sampleRate:** Sample rate: Original, 48000 Hz, 44100 Hz, 22050 Hz, or 16000 Hz.
- **channels:** Audio channels: Original, Stereo (2ch), or Mono (1ch).

## Outputs

- **convertedAudio:** Transcoded audio Blob ready for playback preview and download.

## Steps

1. Read local audio file into browser memory as an ArrayBuffer.
2. Load FFmpeg WebAssembly single-threaded core and static worker in browser Web Worker.
3. Write audio input file into virtual in-memory filesystem.
4. Construct FFmpeg transcode arguments with selected codec (-c:a), bitrate (-b:a), sample rate (-ar), and channels (-ac).
5. Execute conversion while tracking percentage progress.
6. Read converted audio from FFmpeg virtual memory into a Blob.
7. Provide instant HTML5 audio preview and direct download link. Files never leave the browser.

## FAQs

### Is my audio uploaded to any server or cloud storage?

No. Conversion executes entirely on your local device using a WebAssembly build of FFmpeg inside a browser Web Worker. Your audio tracks never leave your computer or phone.

### Which audio formats can I convert between?

You can input WAV, MP3, AAC, M4A, OGG, FLAC, WMA, and AIFF files. You can convert to MP3, WAV, AAC, OGG, or FLAC.

### What audio bitrate should I select for MP3 conversion?

For spoken word, lectures, and podcasts, 128 kbps provides clear voice quality with small file size. For music and general audio, 192 kbps is the balanced standard. For archival or audiophile listening, 320 kbps offers near-transparent MP3 fidelity.

### What does mono vs stereo channel conversion do?

Stereo uses two independent audio channels (left and right) for spacious acoustic depth. Mono combines audio into a single channel, reducing file size by roughly half, ideal for voice recordings and interview transcripts.

### Why does in-browser audio transcoding run so fast?

Unlike video compression which must process millions of video frames, audio stream processing has a much lower data density. Modern browser WebAssembly engines encode minutes of audio in just a few seconds.

### How do I convert audio locally from the command line?

Install FFmpeg and run: ffmpeg -i input.wav -c:a libmp3lame -b:a 192k -ar 44100 output.mp3. For mono: add -ac 1. For lossless FLAC: ffmpeg -i input.wav -c:a flac output.flac.

## Related tools

- [GIF compressor](https://plaintools.io/convert/gif-compressor.md) — HTML: https://plaintools.io/convert/gif-compressor
- [Video compressor](https://plaintools.io/convert/video-compressor.md) — HTML: https://plaintools.io/convert/video-compressor
