{
  "schemaVersion": 1,
  "contentVersion": "ca42e61ede0a24f789d7287a0001244ad22f4abf",
  "id": "docs/codecs/audio/intro",
  "collection": "docs",
  "title": "Intro",
  "description": "A short primer on digital audio — sample rate, bit depth, channels, lossless versus lossy coding, and how perceptual codecs work.",
  "canonicalUrl": "https://encode.wiki/codecs/audio/intro/",
  "apiUrl": "https://encode.wiki/api/v1/documents/docs/codecs/audio/intro.json",
  "markdownUrl": "https://encode.wiki/api/v1/markdown/docs/codecs/audio/intro.md",
  "status": "current",
  "tags": [
    "migrated"
  ],
  "license": "CC BY-SA 4.0",
  "dates": {
    "lastVerified": "2026-10-08T00:00:00.000Z"
  },
  "authors": [],
  "sources": [
    {
      "title": "Xiph Digital Show and Tell — sampling and quantization",
      "url": "https://xiph.org/video/vid2.shtml",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "RFC 9639 — Free Lossless Audio Codec (FLAC)",
      "url": "https://www.rfc-editor.org/rfc/rfc9639",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    }
  ],
  "provenance": {
    "originUrl": "https://github.com/av1-community-contributors/codec-wiki/blob/37c3317fd058b23c71a87679bed5619a98f77752/docs/audio/intro.mdx",
    "originCommit": "37c3317fd058b23c71a87679bed5619a98f77752",
    "migratedAt": "2026-08-21T00:00:00.000Z",
    "modified": true,
    "originPath": "docs/audio/intro.mdx"
  },
  "headings": [
    {
      "depth": 2,
      "text": "The basics",
      "anchor": "the-basics"
    },
    {
      "depth": 2,
      "text": "Lossless versus lossy",
      "anchor": "lossless-versus-lossy"
    },
    {
      "depth": 2,
      "text": "Inspecting a file",
      "anchor": "inspecting-a-file"
    }
  ],
  "sections": [
    {
      "id": "_preamble",
      "title": "Page introduction",
      "depth": 0,
      "canonicalUrl": "https://encode.wiki/codecs/audio/intro/",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/audio/intro/_preamble.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/audio/intro/_preamble.md",
      "checksum": "a58028ad4db7ca066b7efd7240ec97d6de573312c49806a6e615d51ba6a22c10",
      "bytes": 182
    },
    {
      "id": "the-basics",
      "title": "The basics",
      "depth": 2,
      "anchor": "the-basics",
      "canonicalUrl": "https://encode.wiki/codecs/audio/intro/#the-basics",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/audio/intro/the-basics.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/audio/intro/the-basics.md",
      "checksum": "aff4d008971ecaa79cd9312d44dbb9dea6f25c8bad571b34e6e697719c461f81",
      "bytes": 1220
    },
    {
      "id": "lossless-versus-lossy",
      "title": "Lossless versus lossy",
      "depth": 2,
      "anchor": "lossless-versus-lossy",
      "canonicalUrl": "https://encode.wiki/codecs/audio/intro/#lossless-versus-lossy",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/audio/intro/lossless-versus-lossy.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/audio/intro/lossless-versus-lossy.md",
      "checksum": "3b7663c171a4a875dc67cee6a7bc81c41c28960949d6e3eaad8fa34bacf27dbf",
      "bytes": 1329
    },
    {
      "id": "inspecting-a-file",
      "title": "Inspecting a file",
      "depth": 2,
      "anchor": "inspecting-a-file",
      "canonicalUrl": "https://encode.wiki/codecs/audio/intro/#inspecting-a-file",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/audio/intro/inspecting-a-file.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/audio/intro/inspecting-a-file.md",
      "checksum": "2fdecdc5d908ea484f3deba97b7553c1cff1022e982eb778a991c9b76b68a353",
      "bytes": 411
    }
  ],
  "outboundReferences": [
    "/codecs/audio/",
    "/codecs/audio/aac/",
    "/codecs/audio/alac/",
    "/codecs/audio/flac/",
    "/codecs/audio/mp3/",
    "/codecs/audio/opus/",
    "/codecs/audio/vorbis/",
    "/codecs/audio/wavpack/",
    "/reference/image-audio-support/",
    "/start-here/lossless/",
    "/start-here/lossy/"
  ],
  "checksum": "94260ef96c9ef739265d8720c13e129cc2a98fa637a9eb2cc389adf81b5c0b78",
  "contentFormat": "markdown",
  "markdown": "Digital audio is a waveform stored as a series of numbers. Everything else in this section — codecs, containers, spatial formats — is about storing or compressing those numbers.\n\n## The basics\n\n- **Sample rate** is how many measurements per second are taken. CDs use 44.1 kHz; video and most production work use 48 kHz. A sampled signal can represent frequencies up to half the sample rate (the Nyquist frequency), so 44.1 kHz already covers everything people can hear. Higher rates mainly matter for production headroom, not playback.\n- **Bit depth** is the precision of each sample. 16 bits gives roughly 96 dB of dynamic range and 24 bits far more than any real recording needs. Dropping to a lower depth should be done with dither, which replaces correlated quantization distortion with low-level noise.\n- **Channels** are the separate signals in a stream: mono, stereo, 5.1 and so on. A channel count says nothing about speaker positions — two channels can be stereo or two unrelated mono tracks — so layout and channel order matter for surround.\n- **Bitrate** is the size of the stream per second. Uncompressed PCM is sample rate × bit depth × channels: stereo 48 kHz/24-bit is 2,304 kbit/s. Compressed bitrate depends on the codec and settings.\n\nUpsampling or converting to a higher bit depth adds no detail. A 48 kHz file made from a 22 kHz source still contains nothing above 11 kHz.\n\n## Lossless versus lossy\n\n**Lossless** codecs ([FLAC](/codecs/audio/flac/), [ALAC](/codecs/audio/alac/), [WavPack](/codecs/audio/wavpack/), Dolby TrueHD) shrink PCM typically to around half its size and decode back to identical samples. Use them for masters, archives and anything you may edit or re-encode later. See [lossless compression](/start-here/lossless/) for how they work.\n\n**Lossy** codecs ([Opus](/codecs/audio/opus/), [AAC](/codecs/audio/aac/), [MP3](/codecs/audio/mp3/), [Vorbis](/codecs/audio/vorbis/), AC-3) discard information to reach much smaller files, often a tenth of the PCM size or less. They are built on perceptual coding: a transform (usually an MDCT) splits the signal into frequency bands, and a psychoacoustic model decides which components are masked by louder neighbours and can be quantized coarsely or dropped. At a sufficient bitrate the result is transparent, meaning indistinguishable from the source in a blind test. Where \"sufficient\" lies depends on the codec, encoder and material. See [lossy compression](/start-here/lossy/).\n\nNever re-encode lossy files if you can avoid it. Each generation adds new artifacts on top of the old ones, and transcoding a lossy file to a lossless format only preserves its flaws at a larger size. Keep a lossless master and make delivery copies from that.\n\n## Inspecting a file\n\n```sh\nffprobe -v error -select_streams a -show_entries stream=codec_name,sample_rate,channels,channel_layout,bit_rate input.mka\n```\n\nCheck this before and after any conversion, and listen for clipping, downmix cancellation and timing problems. The [audio overview](/codecs/audio/) compares the codecs and [image and audio support](/reference/image-audio-support/) covers browser playback.\n"
}
