AudioAlign icon indicating copy to clipboard operation
AudioAlign copied to clipboard

[BUG ?] Does AA lacks of "sync-to-reference track" feature ?

Open MarcoRavich opened this issue 3 months ago • 3 comments

Hi there, I'm using AA-generated CSV export file to setup - using this python script - an audio dataset (for machine learning purposes) but, multiple tracks don't report all syncs related to the "reference" track.

Here's the CSV synch file between FINAL_rc1.wav and some MTS files:

Track A;Track B;Track A Position;Track B Position;Similarity;Offset;Source;Track A Position (ms);Track B Position (ms);Offset (ms)
SXM_ALL.MTS;DXF_ALL.MTS;0:00:59:42.3628447;0:00:59:26.6995646;0,9472656;0:00:00:00.0000000;FP-CP;3582362;3566699;0
SXM_ALL.MTS;SXF_ALL.MTS;0:00:01:12.9637155;0:00:01:21.1843251;0,9432373;0:00:00:00.0000000;FP-CP;72963;81184;0
FINAL_rc1.wav;SXF_ALL.MTS;0:01:06:14.6995646;0:01:04:49.7764877;0,9189453;0:00:00:00.0000000;FP-CP;3974699;3889776;0
FINAL_rc1.wav;DXH_ALL.MTS;0:01:06:14.7111756;0:00:43:39.4368650;0,9189453;0:00:00:00.0000000;FP-CP;3974711;2619436;0

But these are single MTS to WAV synch values:

FINAL_rc1.wav;DXH_ALL.MTS;0:01:06:14.7111756;0:00:43:39.4368650;0,9189453;0:00:00:00.0000000;FP-CP;3974711;2619436;0

FINAL_rc1.wav;SXF_ALL.MTS;0:01:06:14.6995646;0:01:04:49.7764877;0,9189453;0:00:00:00.0000000;FP-CP;3974699;3889776;0

FINAL_rc1.wav;SXM_ALL.MTS;0:00:26:23.0246734;0:00:24:49.9274311;0,9024658;0:00:00:00.0000000;FP-CP;1583024;1489927;0

FINAL_rc1.wav;DXF_ALL.MTS;0:01:01:12.6386067;0:00:59:23.9825835;0,89990234;0:00:00:00.0000000;FP-CP;3672638;3563982;0

...shouldn't be identical ?

Does AA allow user set a "referenc track" (to synch all others to) ?

Thanks in advance.

MarcoRavich avatar Sep 18 '25 14:09 MarcoRavich

Hi, I'm afraid I don't fully understand your issue. Could you clarify what the discrepancy is between the result you’re seeing and what you expect?

For context: The "Export Matches to CSV" option simply writes the list of matches from the "Matching Points" list in the "Match & Align" window. When you run an alignment, that list is usually filtered (the “remove unused matching points” checkbox is enabled by default), which can reduce the number of sync points in a way that might look unexpected.

Regarding the reference track: AudioAlign doesn’t have an explicit concept of one, but you can achieve it implicitly by moving your preferred reference track to the top of the timeline and optionally locking its position.

protyposis avatar Sep 22 '25 13:09 protyposis

Sorry to be unclear: I would expect any track is synched with the "master" one (or, as you say, the 1st one)...

....here's what I've synced: AudioAlign Sync

The result CSV is:

Track A;Track B;Track A Position;Track B Position;Similarity;Offset;Source;Track A Position (ms);Track B Position (ms);Offset (ms)
FINAL_rc1.wav;SXF_ALL.MTS;0:01:08:28.5283019;0:01:07:03.6632801;0,62280273;0:00:00:00.0000000;FP-HK02;4108528;4023663;0
FINAL_rc1.wav;DXH_ALL.MTS;0:00:45:13.6023222;0:00:22:38.2467344;0,6224365;0:00:00:00.0000000;FP-HK02;2713602;1358246;0
SXM_ALL.MTS;DXH_ALL.MTS;0:01:27:11.6516691;0:01:06:09.3701016;0,62854004;0:00:00:00.0000000;FP-HK02;5231651;3969370;0
FINAL_rc1.wav;DXF_ALL.MTS;0:01:08:23.4542816;0:01:06:34.8098694;0,616333;0:00:00:00.0000000;FP-HK02;4103454;3994809;0

If I understand, the 4th line are the sync values for SXM_ALL.MTS<>DXH_ALL.MTS and not FINAL_rc1.wav<>SXM_ALL.MTS as I would expect.

...maybe I'm doing something wrong ?

MarcoRavich avatar Sep 22 '25 17:09 MarcoRavich

I see. Your screenshot looks like the result of an alignment with “remove unused matching points” enabled, where AudioAlign kept only the best matching points that lead to a synchronization of all tracks. In this case, SXM_ALL.MTS is indirectly synchronized to FINAL_rc1.wav via DXH_ALL.MTS (transitive synchronization). If the fingerprint analysis found any direct sync points between FINAL_rc1.wav and SXM_ALL.MTS, which I can't see from the screenshot, they got filtered out due to lower similarity.

So your result is likely the ideal solution because it uses the best matches. If you need the offsets to the reference track, you can calculate them yourself in your Python script.

Example calculation (generated with ChatGPT)

Summary of Calculation

The original CSV contains synchronization points between pairs of tracks, but no direct match between FINAL_rc1.wav and SXM_ALL.MTS. To calculate this, we chain through a common reference track (DXH_ALL.MTS):

  • From the CSV:

    FINAL_rc1.wav @ 2,713,602 ms  ≡  DXH_ALL.MTS @ 1,358,246 ms
    SXM_ALL.MTS   @ 5,231,651 ms  ≡  DXH_ALL.MTS @ 3,969,370 ms
    
  • Converting both into offsets relative to DXH:

    FINAL = DXH + 1,355,356 ms
    SXM   = DXH + 1,262,281 ms
    
  • Eliminating DXH gives:

    FINAL = SXM + 93,075 ms
    

So FINAL_rc1.wav is 93.075 seconds ahead of SXM_ALL.MTS. Using this offset, we replace the SXM_ALL.MTS;DXH_ALL.MTS row with a direct match between FINAL_rc1.wav and SXM_ALL.MTS.


Updated CSV

Track A;Track B;Track A Position;Track B Position;Similarity;Offset;Source;Track A Position (ms);Track B Position (ms);Offset (ms)
FINAL_rc1.wav;SXF_ALL.MTS;0:01:08:28.5283019;0:01:07:03.6632801;0,62280273;0:00:00:00.0000000;FP-HK02;4108528;4023663;0
FINAL_rc1.wav;DXH_ALL.MTS;0:00:45:13.6023222;0:00:22:38.2467344;0,6224365;0:00:00:00.0000000;FP-HK02;2713602;1358246;0
FINAL_rc1.wav;SXM_ALL.MTS;0:01:28:44.7260000;0:01:27:11.6510000;0,62854004;0:00:00:00.0000000;FP-HK02;5324726;5231651;0
FINAL_rc1.wav;DXF_ALL.MTS;0:01:08:23.4542816;0:01:06:34.8098694;0,616333;0:00:00:00.0000000;FP-HK02;4103454;3994809;0

Alternatively, if your initial fingerprinting result contained direct matches between the reference and all other tracks, you can manually remove undesirable matches from the "Matching Points" list (click headers to sort by track name, batch select all matches which don't belong to FINAL_rc1.wav with Shift + Click and Del) and then apply the alignment. This won't use the very best matches, but they might still be good enough for a correct synchronization.

protyposis avatar Sep 22 '25 18:09 protyposis