mic
mic

Reputation: 4475

What is the difference between these 2 wav files?

I am trying to use a program called arss to create a spectrogram from a wav file. I have 2 wav files, one works and the other does not (it was converted to wav from mp3).

The error that arss throws at me is:

This WAVE file is not currently supported.

Which is fine, but I have no idea what parts of my wav file to change so that it will be supported. The docs don't help here (as far as I can tell)

When I run mediainfo on both wav files, I get the following specs:

working wav:

General
Complete name                            : working.wav
Format                                   : Wave
File size                                : 1.15 MiB
Duration                                 : 6 s 306 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 1 536 kb/s

Audio
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : 1
Duration                                 : 6 s 306 ms
Bit rate mode                            : Constant
Bit rate                                 : 1 536 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Bit depth                                : 16 bits
Stream size                              : 1.15 MiB (100%)

not working wav:

General
Complete name                            : not_working.wav
Format                                   : Wave
File size                                : 5.49 MiB
Duration                                 : 30 s 0 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 1 536 kb/s
Writing application                      : Lavf57.83.100

Audio
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : 1
Duration                                 : 30 s 0 ms
Bit rate mode                            : Constant
Bit rate                                 : 1 536 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Bit depth                                : 16 bits
Stream size                              : 5.49 MiB (100%)

Comparing the audio specs of both files, I can't tell any difference between anything other than the file size and duration. I even updated the Sampling rate of the non-working wav using ffmpeg so that it would match the working one at 48.0kHz, but no luck.

Any idea?

Both wav files are available here.

Upvotes: 1

Views: 1819

Answers (2)

Alexis Wilke
Alexis Wilke

Reputation: 20818

I have an older version of ffmpeg and the -bitextact option alone did not help much. That is, it did remove some of the data from the hunk, but the LIST hunk was still present with other data.

You may have to also ask for no metadata at all with the -map_metadata option like so:

ffmpeg ... -i <input> ... -flags +bitexact -map_metadata -1 ... <output>

(The ... represent location with other command line options as required in your case)

By adding the -map_metadata -1, it really removed everything and the LIST hunk is now fully gone.

Upvotes: 1

Gyan
Gyan

Reputation: 93339

FFmpeg, by default, writes a LIST chunk, with some metadata, before the data chunk. ARSS has a rigid parser and expects the data chunk to start at a fixed byte offset (0x24). FFmpeg can be told to skip writing the LIST chunk using the bitexact option.

ffmpeg -i not_working.wav -c copy -bitexact new.wav

Note that ARSS doesn't check for sampling rate, only that WAVs have little endian PCM.

Here's a related Q, not quite a duplicate, linked for future readers:

ffmpeg - Making a Clean WAV file

Upvotes: 3

Related Questions