Run ffprobe or soxi to read a WAV header. Both utilities report the codec, sample rate, channels, and length straight from the header. Compare that length against the file size. A mismatch is the fastest way to confirm a broken header before you attempt any repair. That single check saves you from trying to fix audio data that was never the problem.

What Ffprobe and Soxi Show

Ffprobe Output

ffprobe file.wav displays the codec (usually PCM), sample rate, number of channels, and length. For a standard WAV file, the output looks like:

Duration: a few minutes, bitrate: a high rate

Soxi Output

soxi file.wav (part of SoX) shows channels, sample rate, precision (bits per sample), length, and file size. Its output is more compact:

Channels : 2
Sample Rate : a high rate
Precision : 16-bit
Duration : a few minutes
File Size : 10.6M

Both tools read the header only, not the audio data. A corrupt header means the values they report are wrong.

Why You Should Verify a WAV File Before Repairing

If a WAV file plays oddly, skips, or shows a length far shorter or longer than the recording, the header likely contains incorrect metadata. Common header problems include:

  • The data size field is set to zero. Players then think the file has no audio.
  • The data size is larger than the actual file. Players seek past the end of the file.
  • The length reported by ffprobe or soxi does not match the real length of the recording.

Verify the header first. It tells you whether the file needs a header repair or whether the audio data itself is damaged. If the header is wrong, recalculate the data size and you can often fix it.

How to Read the WAV Header with Ffprobe

Step by Step

  1. Open a terminal or command prompt.
  2. Navigate to the folder containing your WAV file.
  3. Run: ffprobe file.wav
  4. Look for the line that says Duration. That is the declared recording length.

The output also shows the stream details: codec (e.g., pcm_s16le), sample rate, and number of channels. If the length is a fraction of a second or hours for a short clip, the header is corrupt. Do not trust it.

How to Read the WAV Header with Soxi

Step by Step

  1. Install SoX if you have not already. It is available for Windows, macOS, and Linux.
  2. Open a terminal and go to the directory with your WAV file.
  3. Run: soxi file.wav
  4. Examine the Duration and File Size values.

soxi file.wav gives you channels, sample rate, precision, length, and file size in one output. This is the quickest way to get a full header summary.

Comparing Declared Duration with Actual File Size

Once you have the header values, check them against the file size. The expected data size for a PCM WAV is:

Expected data size = sample rate x channels x (bits per sample / 8) x seconds

For a stereo 16 bit recording of a typical length, calculate it yourself:

  • Sample rate x 2 channels x 2 bytes per sample x a few seconds.

Compare that to the actual file size, remembering the file includes a small header. If the header declares a length that would require more data than the file contains, or declares a data size of zero, the header is corrupt. A data size of zero or larger than the file is the typical signature of an interrupted recording.

What to Do When the Header is Wrong

You have confirmed the header is incorrect. The length does not match the file size, or the data size is zero or too large. The file can often be repaired. Use a tool that recalculates the header from the actual audio data. wav.repair offers a free online service that fixes such header problems without adding a watermark.

Make a backup copy of the original file before you repair. A header repair rewrites the metadata. It does not touch the audio samples themselves.