Skip to content

DetectedAudioFormat

Audio container/codec formats detectable via magic byte inspection.

type DetectedAudioFormat = "wav" | "ogg" | "mp3" | "aac" | "webm" | "flac" | "aiff" | "mp4";

Defined in: src/utils/audioFormat.ts:59

Audio container/codec formats detectable via magic byte inspection.

Remarks

Each value corresponds to a format identifiable from the first 12 bytes of audio data. Formats not in this list (e.g., raw PCM, proprietary codecs) cannot be detected and will return null from detectAudioFormat.

  • 'wav' — RIFF WAVE container (magic: RIFF....WAVE)
  • 'ogg' — OGG container, typically Opus or Vorbis (magic: OggS)
  • 'mp3' — MP3 with ID3 tag or MPEG sync word (magic: ID3 or 0xFF 0xE0+)
  • 'aac' — AAC with ADTS framing (magic: 0xFF 0xF0+)
  • 'webm' — WebM/Matroska container (magic: EBML header 0x1A45DFA3)
  • 'flac' — Free Lossless Audio Codec (magic: fLaC)
  • 'aiff' — Audio Interchange File Format (magic: FORM....AIFF or AIFC)
  • 'mp4' — MP4/M4A container (magic: ftyp at offset 4)

See

detectAudioFormat for the detection function

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency