mirror of
https://github.com/OldUnreal/libxmp.git
synced 2026-04-02 21:37:43 -07:00
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.
18 lines
466 B
C
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
|