Flocking includes a round-trip encoding/decoding unit test to verify that our WAVE file encoder is compatible and does not introduce significant noise. However, its comparison algorithm is naive, and causes failures in any case where the audio file doesn't match the current sample rate (due to small numeric differences caused by resampling the file to the current rate and imprecision in the int > float conversion process).
The tests should be improved in the following ways:
Audio buffers should be compared within the "native" numeric representation of the audio file. So, in the case of int16 files, both buffers should be converted to int16 arrays prior to comparison
The test case should be expanded to test all typical sampling rates we support—44.1, 48, 88.2, and 96 KHz.
Flocking includes a round-trip encoding/decoding unit test to verify that our WAVE file encoder is compatible and does not introduce significant noise. However, its comparison algorithm is naive, and causes failures in any case where the audio file doesn't match the current sample rate (due to small numeric differences caused by resampling the file to the current rate and imprecision in the int > float conversion process).
The tests should be improved in the following ways: