[alsa-devel] aplay\arecord compare utility

Ricard Wanderlof ricard.wanderlof at axis.com
Mon Feb 26 08:53:12 CET 2018


On Fri, 23 Feb 2018, Muni Sekhar wrote:

>  [ Please keep me in CC as I'm not subscribed to the list]
> 
> I?m using an alsa utilities(aplay & arecord) for sound loopback
> testing. From Linux host , sending & receiving the wav file.
> 
> At end I want to compare the sent & received wav file. Does Linux has
> any utility to support this one?

If the wav headers are identical, you can just use cmp or diff. Otherwise, 
you can extract the raw audio using sox, which gives you files with just 
the audio samples in them, and then you can use cmp or diff to compare 
them. It won't work though if the files aren't actually identical, for 
instance if there is an offset of a couple of samples in one compared to 
the other.

If I had to compare two wav files which were offset by a small number of 
samples, I'd open them in Audacity, manually align them, then sum the 
result, write to a new file and verify that the file just contained zeros.

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30


More information about the Alsa-devel mailing list