audio/flac means: audio/flac is the media type for Free Lossless Audio Codec, an open format that compresses audio without any quality loss. FLAC typically halves WAV size while preserving every sample, making it the preferred format for audiophile archives and lossless distribution. Audio media types describe sound containers and codecs. The subtype tells the player which demuxer and decoder to load, and browsers use it in Accept headers and canPlayType() checks to negotiate a format they actually support. Choosing a widely supported audio type avoids silent playback failures on devices that lack a proprietary codec. You will encounter audio/flac in contexts such as lossless music archives and distribution; high-fidelity audio preservation; source masters before lossy export. It is commonly associated with the file extension(s) .flac. FLAC is lossless, so files are larger than MP3/AAC but smaller than WAV. Browser support is good in modern engines but not universal; for web delivery to all clients provide a lossy fallback. FLAC is ideal when fidelity must be preserved exactly.
When you'll see audio/flac
- Lossless music archives and distribution
- High-fidelity audio preservation
- Source masters before lossy export
How to handle it
When delivering audio, declare the precise container type, support byte-range requests so players can seek, and offer at least one broadly supported fallback. Test playback with canPlayType() across target browsers rather than assuming a codec is present. For streaming, set the correct type on each segment and keep timestamps consistent so the player can buffer and seek without glitches. As a final checklist for audio types: support byte-range requests for seeking, offer a universally supported fallback, normalize loudness for consistent playback, test canPlayType across target browsers, and keep segment timestamps aligned when streaming so buffers do not stall.
Notes & gotchas
FLAC is lossless, so files are larger than MP3/AAC but smaller than WAV. Browser support is good in modern engines but not universal; for web delivery to all clients provide a lossy fallback. FLAC is ideal when fidelity must be preserved exactly.
Examples
HTTP/1.1 200 OK
Content-Type: audio/flac
Accept-Ranges: bytes
Content-Disposition: inline; filename="sample.flac"
[binary audio payload: the encoded bytes of a sample .flac] curl -i -H "Accept: audio/flac" https://api.example.com/v1/resource # inspect the returned Content-Type const res = await fetch("/media/sample.flac", { headers: { Accept: "audio/flac" } });
const blob = await res.blob(); // blob.type should be "audio/flac"
const url = URL.createObjectURL(blob); // assign to img.src / audio.src / video.src
// revoke with URL.revokeObjectURL(url) when done to free memory import requests
res = requests.get("https://api.example.com/v1/resource",
headers={"Accept": "audio/flac"}, timeout=30)
res.raise_for_status()
assert res.headers["Content-Type"].startswith("audio/flac")
with open("sample.flac", "wb") as fh:
fh.write(res.content) # raw bytes; use stream=True for large files Frequently asked questions
Is FLAC better than MP3?
FLAC is lossless (no quality discarded) while MP3 is lossy. FLAC files are larger; choose FLAC for archival fidelity and MP3/AAC for bandwidth-constrained streaming.
Can browsers play FLAC?
Modern Chromium, Firefox and Safari support FLAC, but older clients may not. Offer a lossy fallback if you must guarantee playback everywhere.
Why does my audio file fail to play in some browsers?
Codec support varies. Check HTMLMediaElement.canPlayType() with the exact MIME type, and provide a fallback source. A container the browser recognizes but a codec it lacks will still fail silently.
Are audio MIME types the same as file extensions?
They map closely but are not identical: .mp3 maps to audio/mpeg, .m4a to audio/mp4, .ogg to audio/ogg. The container and codec both matter, so trust the declared type over the extension when they conflict.
How do I let users seek within an audio file?
Serve it with Accept-Ranges: bytes and support HTTP range requests so the player can fetch arbitrary offsets. Without range support the player must download the whole file before seeking works.
Try the Base64 Encoder
Encode and decode Base64 with UTF-8 and URL-safe options.