How to Optimize Audio Files for Faster Page Loads
Audio files are often the heaviest assets on a page. A few simple changes can cut their size dramatically without listeners noticing any difference.
1. Pick a sensible bitrate
Higher bitrates mean bigger files. For most websites these settings are plenty:
- Music: 128–192 kbps MP3
- Speech and podcasts: 64–96 kbps MP3, or 32–48 kbps Opus
Exporting a 320 kbps file “just in case” can easily double the download for no audible benefit on laptop speakers or phones.
2. Use mono for spoken content
A single voice doesn’t need two channels. Switching speech recordings to mono roughly halves the file size at the same quality.
3. Trim silence and normalize volume
Remove long pauses at the start and end of each file, and normalize loudness so visitors don’t have to adjust the volume between tracks. Free tools such as Audacity can do both, and command-line tools like FFmpeg can batch-process whole folders.
ffmpeg -i input.wav -ac 1 -b:a 64k output.mp3
4. Don’t preload what people may not play
Set preload="none" or preload="metadata" on audio elements, especially when a page lists many tracks. The browser will then fetch the file only when the visitor presses play.
5. Let the browser and CDN cache files
Audio rarely changes after publishing, so it can be cached for a long time. Send a long Cache-Control lifetime for your media folder, and if you change a file, upload it with a new name. A CDN can then serve files from a location close to each listener.
6. Make sure range requests work
Browsers request audio in pieces so visitors can skip ahead without downloading the whole file. Most web servers support this automatically, but check that your server or CDN returns 206 Partial Content responses for audio files.
7. Consider dedicated hosting for large libraries
If you publish hours of audio each week, a podcast host or object storage service may be cheaper and faster than serving everything from your own web server.
Quick checklist
- Bitrate matched to content
- Mono for speech
- Silence trimmed
- Preload set to none or metadata
- Long cache lifetime and CDN
- Range requests working
