Batch audio conversion to WAV (ffmpeg)

Description

Converting heterogeneous interview recordings into a consistent 16 kHz mono WAV format in one scripted pass, so transcription and diarisation tools run reliably.

Research recordings arrive as MP3, M4A, MP4 video or platform-specific formats with varying sample rates and channel layouts. Speech models such as Whisper and pyannote expect 16 kHz mono PCM audio. FFmpeg converts, resamples, downmixes, trims and normalises audio from the command line, and pydub wraps it for Python scripts. Batch conversion makes this repeatable: one script processes a folder, preserves original files, names outputs consistently and logs durations. Rigour lies in never overwriting originals, keeping file naming tied to participant IDs rather than names, checking output durations match inputs, and applying loudness normalisation consistently so quiet participants are not under-transcribed.

Attributes

Loss type
Active
Stage
Discovery
Effort
Hours

Steps

  1. Copy original recordings to a read-only raw folder and rename them to pseudonymous participant IDs.
  2. Run ffmpeg per file, e.g. ffmpeg -i input.m4a -ar 16000 -ac 1 -c:a pcm_s16le output.wav.
  3. Optionally apply loudness normalisation (e.g. the loudnorm filter targeting about -16 to -23 LUFS) for quiet or uneven recordings.
  4. Extract audio from video files and strip metadata that may contain names or locations.
  5. Log input and output durations and flag any file where they differ by more than about 1 second.
  6. Keep the script under version control so the preprocessing is reproducible.

Sources

  • whisper.cpp (local, privacy-preserving)
  • openai-whisper (cloud)
  • pyannote.audio (diarisation)
  • ffmpeg
  • pydub
  • FFmpeg documentation (ffmpeg.org)
  • The Inquiry Series, C9 — Whisper — Batch Transcription at Scale

Also known as

  • Audio preprocessing
  • Audio normalisation for ASR

Categories

  • Analytics & Behaviour
  • Computational & Machine Learning