Files
libxmp/test-dev/test_player_sample_sync.c
Alice R 755c28071d Don't increment voice position by step value at loop/tick end. (#496)
Since commit b7d6a6ea, libxmp has added an extra step to voice
positions if they are close to or at the end of their loop on a tick
boundary. This results in samples with loops being very slightly
too fast. This patch corrects this behavior so samples with loops
play at the correct speed.

The issue can be demonstrated with two looping samples, where one
sample is two inverted copies of the other sample. When played back
at the same pitch, they should cancel entirely and be silent, but
this extra step causes them to gradually diverge instead.
2021-12-22 08:06:29 -07:00

18 lines
466 B
C

#include "test.h"
/*
Two samples played back at the same frequency should always step
through their sample frames at the same rate, regardless of the
lengths of their loops. Example: a sample with a loop of 16 frames
and a sample with a loop of 32 frames should repeat their loops at
exactly a rate of 2:1 if played at the same frequency.
*/
TEST(test_player_sample_sync)
{
compare_mixer_data(
"data/sample_sync.it",
"data/sample_sync.data");
}
END_TEST