fork(fix): Clone AMLL 并修复 BUG

- 将AMLL Clone到本以地进行修复和优化(emm虽然这很不优雅但是暂时无时间做子模块和Fork)
- 修复在当前播放歌词行不可见的视口Seek会出现滚动偏移的问题
This commit is contained in:
lqtmcstudio
2026-06-07 00:02:14 +08:00
parent 783d2c3dee
commit 72f4510dc8
458 changed files with 86075 additions and 1665 deletions

View File

@@ -0,0 +1,5 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`TTML Generator - toTTMLResult > generates TTMLResult from AMLL data and serialize it to XML 1`] = `"<tt xmlns:amll="http://www.example.com/ns/amll" xmlns:itunes="http://music.apple.com/lyric-ttml-internal" xmlns:ttm="http://www.w3.org/ns/ttml#metadata" xmlns:tts="http://www.w3.org/ns/ttml#styling" itunes:timing="Word" xmlns="http://www.w3.org/ns/ttml"><head><metadata><ttm:agent type="person" xml:id="v1"/><ttm:agent type="person" xml:id="v2"/><iTunesMetadata xmlns="http://music.apple.com/lyric-ttml-internal"><transliterations><transliteration xml:lang="zh-Latn"><text for="L1"><span begin="1.000" end="2.000">ni</span><span begin="2.000" end="3.000">hao</span><span ttm:role="x-bg"><span begin="3.000" end="4.000">(shi</span><span begin="4.000" end="5.000">jie)</span></span></text></transliteration></transliterations></iTunesMetadata><amll:meta key="musicName" value="Test Song"/><amll:meta key="artists" value="Artist A"/><amll:meta key="artists" value="Artist B"/></metadata></head><body dur="3.000"><div begin="1.000" end="3.000"><p begin="1.000" end="3.000" itunes:key="L1" ttm:agent="v1"><span begin="1.000" end="2.000">你</span><span begin="2.000" end="3.000">好</span><span ttm:role="x-translation" xml:lang="en">你好</span><span ttm:role="x-bg" begin="3.000" end="5.000"><span begin="3.000" end="4.000">(世</span><span begin="4.000" end="5.000">界)</span><span ttm:role="x-translation" xml:lang="en">世界</span></span></p></div></body></tt>"`;
exports[`TTML Generator Integration > matches the XML snapshot 1`] = `"<tt xmlns:amll="http://www.example.com/ns/amll" xmlns:itunes="http://music.apple.com/lyric-ttml-internal" xmlns:ttm="http://www.w3.org/ns/ttml#metadata" xmlns:tts="http://www.w3.org/ns/ttml#styling" xml:lang="ja" itunes:timing="Word" xmlns="http://www.w3.org/ns/ttml"><head><metadata><ttm:agent type="person" xml:id="v1"><ttm:name type="full">Vocalist A (Taro)</ttm:name></ttm:agent><ttm:agent type="person" xml:id="v2"><ttm:name type="full">Vocalist B (Hanako)</ttm:name></ttm:agent><ttm:agent type="group" xml:id="v1000"><ttm:name type="full">Chorus Group</ttm:name></ttm:agent><iTunesMetadata xmlns="http://music.apple.com/lyric-ttml-internal"><transliterations><transliteration xml:lang="ja-Latn"><text for="L1"><span begin="10.000" end="10.500">Ko</span><span begin="10.500" end="10.800">re</span> <span begin="10.800" end="11.000">wa</span> <span begin="11.200" end="11.800">tesuto</span></text><text for="L2"><span begin="15.000" end="15.800">Futatsume</span> <span begin="16.000" end="16.500">no</span> <span begin="16.500" end="17.000">rain</span></text><text for="L3"><span begin="20.000" end="21.500">Kōrasu</span> <span begin="21.500" end="22.000">desu</span><span ttm:role="x-bg"><span begin="22.500" end="23.800">(haikei)</span></span></text></transliteration></transliterations><songwriters><songwriter>作曲者1号</songwriter><songwriter>作曲者2号</songwriter></songwriters></iTunesMetadata><amll:meta key="musicName" value="Complex Test Song"/><amll:meta key="musicName" value="複雑なテストソング"/><amll:meta key="artists" value="Vocalist A (Taro)"/><amll:meta key="artists" value="Vocalist B (Hanako)"/><amll:meta key="album" value="AMLL Parser Test Suite"/><amll:meta key="ncmMusicId" value="123456789"/><amll:meta key="qqMusicId" value="987654321"/><amll:meta key="spotifyId" value="abc123xyz"/><amll:meta key="appleMusicId" value="999888777"/><amll:meta key="isrc" value="JPXX02500001"/><amll:meta key="ttmlAuthorGithub" value="10001"/><amll:meta key="ttmlAuthorGithubLogin" value="TestUser"/></metadata></head><body dur="25.000"><div begin="10.000" end="17.000" itunes:songPart="Verse"><p begin="10.000" end="12.000" itunes:key="L1" ttm:agent="v1"><span begin="10.000" end="10.500" amll:obscene="true">これ</span><span begin="10.500" end="10.800">は</span> <span begin="11.200" end="11.800" amll:empty-beat="5">テスト</span><span ttm:role="x-translation" xml:lang="en-US">This is the first line (Vocalist A)</span><span ttm:role="x-translation" xml:lang="zh-Hans-CN">这是第一行歌词 (演唱者A)</span></p><p begin="15.000" end="17.000" itunes:key="L2" ttm:agent="v2"><span begin="15.000" end="15.800">二つ目</span> <span begin="16.000" end="16.500">の</span> <span begin="16.500" end="17.000">ライン</span><span ttm:role="x-translation" xml:lang="en-US">This is the second line (Vocalist B)</span><span ttm:role="x-translation" xml:lang="zh-Hans-CN">这是第二行歌词 (演唱者B)</span></p></div><div begin="20.000" end="25.000" itunes:songPart="Chorus"><p begin="20.000" end="25.000" itunes:key="L3" ttm:agent="v1000"><span begin="20.000" end="21.500">コーラス</span> <span begin="21.500" end="22.000">です</span><span ttm:role="x-translation" xml:lang="en-US">This is the chorus line</span><span ttm:role="x-translation" xml:lang="zh-Hans-CN">这是合唱部分</span><span ttm:role="x-bg" begin="22.500" end="23.800"><span begin="22.500" end="23.800">(背景)</span><span ttm:role="x-translation" xml:lang="en">Background</span><span ttm:role="x-translation" xml:lang="en-US">With background</span><span ttm:role="x-translation" xml:lang="zh-Hans-CN">带背景音</span><span ttm:role="x-roman" xml:lang="ja-Latn">haikei</span></span></p></div></body></tt>"`;

View File

@@ -0,0 +1,161 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`toAmllLyrics Conversion > computes Apple Music TTML with v2000 other agent correctly in duet alignment 1`] = `
[
"[ 0.36s] 右 [main] : Baby, you've gone far away",
"[ 5.83s] 右 [main] : You've gone far away",
"[ 10.35s] 右 [main] : Baby, you've gone far away",
"[ 15.81s] 右 [main] : You've gone far away",
"[ 20.40s] 左 [main] : 於是茶就這樣冷了",
"[ 25.36s] 左 [main] : 於是天就這樣亮了",
"[ 30.36s] 左 [main] : 於是你就這樣離開了",
"[ 35.38s] 左 [main] : 於是我終於醒了",
"[ 40.35s] 左 [main] : 於是你我從此遠了",
"[ 45.36s] 左 [main] : 於是路從此分岔了",
"[ 50.38s] 左 [main] : 你的臉從此就陌生了",
"[ 54.11s] 左 [main] : Whoa, whoa",
"[ 55.18s] 左 [main] : 雖然我有一點不捨",
"[ 60.37s] 左 [main] : 可是時間不可能停下",
"[ 63.21s] 左 [main] : 不能停下 不會停下",
"[ 65.68s] 左 [main] : 世界一直在變幻著",
"[ 68.20s] 左 [main] : 你也變了 我也變了",
"[ 70.70s] 左 [main] : 過去都已經過去了",
"[ 73.80s] 左 [main] : 既然回不去了 我還在煩惱什麼",
"[ 79.14s] 左 [main] : Oh, whoa",
"[ 80.37s] 左 [main] : 於是告訴自己 不要哭",
"[ 83.20s] 左 [main] : 我不要哭 我不能哭",
"[ 85.69s] 左 [main] : 往前方的路 走一步",
"[ 88.17s] 左 [main] : 再走一步 就會幸福",
"[ 90.69s] 左 [main] : 成長要學會獨處",
"[ 93.81s] 左 [main] : Oh, whoa",
"[ 95.28s] 左 [main] : 雖然有一點孤獨",
"[100.40s] 右 [main] : Baby, you've gone far away",
"[102.52s] 左 [main] : Therefore, I think I should follow, boy",
"[105.72s] 右 [main] : When you've gone far away",
"[107.50s] 左 [main] : Therefore, maybe I'm about to go, yeah, because",
"[110.37s] 右 [main] : Baby, you've gone far away",
"[112.57s] 左 [main] : I don't know, boy, I don't really know why, why",
"[115.68s] 右 [main] : That you've gone far away",
"[117.49s] 左 [main] : Therefore, therefore, I'm now so alone",
"[120.38s] 左 [main] : 於是花一個人種了",
"[125.38s] 左 [main] : 於是夢一個人做了",
"[130.36s] 左 [main] : 於是痛一個人扛下了",
"[133.82s] 左 [main] : Oh, whoa",
"[135.37s] 左 [main] : 快樂一個人笑著",
"[140.35s] 左 [main] : 可是時間不可能停下",
"[143.22s] 左 [main] : 不能停下 不會停下",
"[145.67s] 左 [main] : 世界一直在變幻著",
"[148.21s] 左 [main] : 你也變了 我也變了",
"[150.69s] 左 [main] : 過去都已經過去了",
"[153.76s] 左 [main] : 既然回不去了 我還在煩惱什麼",
"[159.14s] 左 [main] : Oh, whoa",
"[160.39s] 左 [main] : 於是告訴自己 不要哭",
"[163.21s] 左 [main] : 我不要哭 我不能哭",
"[165.70s] 左 [main] : 往前方的路 走一步",
"[168.18s] 左 [main] : 再走一步 就會幸福",
"[170.69s] 左 [main] : 成長要學會獨處",
"[173.82s] 左 [main] : Oh, whoa",
"[175.26s] 左 [main] : 雖然有一點孤獨",
"[180.38s] 右 [main] : Baby, you've gone far away",
"[183.17s] 左 [main] : Ooh, ooh-ooh",
"[185.38s] 右 [main] : Oh, when you've gone far away",
"[187.57s] 左 [main] : Baby, you've gone",
"[189.43s] 左 [main] : Oh, you've gone far away",
"[190.40s] 右 [main] : Baby, you've gone far away",
"[192.57s] 左 [main] : Oh-oh, oh-whoa",
"[195.38s] 右 [main] : Oh, when you've gone far away",
"[196.96s] 左 [main] : Baby, you've gone far away",
"[199.64s] 左 [main] : You've gone far away",
"[200.41s] 右 [main] : Baby, you've gone far away",
"[204.15s] 左 [main] : Oh-ooh",
"[205.38s] 右 [main] : Oh, that you've gone far away",
"[206.32s] 左 [main] : Oh-oh-oh-ooh, oh-oh-oh-ooh",
"[210.39s] 左 [main] : Baby, you've gone far away",
"[213.84s] 左 [main] : Oh, oh",
"[215.58s] 左 [main] : When you've gone far away",
]
`;
exports[`toAmllLyrics Conversion > computes left-right duet layout in Apple Music style with multiple singers correctly in duet alignment 1`] = `
[
"[ 1.15s] 左 [main] : We don't talk about Bruno, no, no, no",
"[ 5.84s] 左 [main] : We don't talk about Bruno, but",
"[ 10.52s] 左 [main] : It was my wedding day",
"[ 11.72s] 左 [bg] : It was our wedding day",
"[ 12.79s] 左 [main] : We were getting ready and there wasn't a cloud in the sky",
"[ 16.94s] 左 [bg] : No clouds allowed in the sky",
"[ 19.26s] 左 [main] : Bruno walks in with a mischievous grin",
"[ 23.12s] 左 [bg] : Thunder",
"[ 24.26s] 左 [main] : You telling this story or am I?",
"[ 26.61s] 左 [bg] : I'm sorry, mi vida, go on",
"[ 28.49s] 左 [main] : Bruno says, "It looks like rain"",
"[ 31.39s] 左 [bg] : Why did he tell us?",
"[ 32.98s] 左 [main] : In doing so, he floods my brain",
"[ 35.71s] 左 [bg] : Abuela, get the umbrellas",
"[ 37.89s] 左 [main] : Married in a hurricane",
"[ 40.66s] 左 [bg] : What a joyous day, but anyway",
"[ 43.13s] 左 [main] : We don't talk about Bruno, no, no, no",
"[ 47.80s] 左 [main] : We don't talk about Bruno",
"[ 51.33s] 右 [main] : Hey, grew to live in fear of Bruno stuttering or stumbling",
"[ 54.20s] 右 [main] : I can always hear him sort of muttering and mumbling",
"[ 56.53s] 右 [main] : I associate him with the sound of falling sand",
"[ 59.42s] 右 [bg] : Ch-ch-ch",
"[ 61.23s] 右 [main] : It's a heavy lift with a gift so humbling",
"[ 63.53s] 右 [main] : Always left Abuela and the family fumbling",
"[ 65.85s] 右 [main] : Grappling with prophecies they couldn't understand",
"[ 69.04s] 右 [main] : Do you understand?",
"[ 70.41s] 左 [main] : Seven-foot frame, rats along his back",
"[ 74.60s] 左 [main] : When he calls your name, it all fades to black",
"[ 79.25s] 左 [main] : Yeah, he sees your dreams and feasts on your screams",
"[ 83.34s] 左 [bg] : Hey",
"[ 85.06s] 左 [main] : We don't talk about Bruno, no, no, no",
"[ 89.71s] 左 [main] : We don't talk about Bruno",
"[ 94.08s] 右 [main] : He told me my fish would die, the next day, dead",
"[ 97.64s] 右 [bg] : No, no",
"[ 98.79s] 左 [main] : He told me I'd grow a gut and just like he said",
"[102.27s] 左 [bg] : No, no",
"[102.38s] 右 [main] : He said that all my hair would disappear, now look at my head",
"[106.99s] 右 [bg] : No, no",
"[108.15s] 左 [main] : Your fate is sealed when your prophecy is read",
"[112.50s] 左 [main] : He told me that the life of my dreams",
"[116.33s] 左 [main] : Would be promised, and someday be mine",
"[121.78s] 左 [main] : He told me that my power would grow",
"[125.54s] 左 [main] : Like the grapes that thrive on the vine",
"[129.04s] 左 [bg] : Óye, Mariano's on his way",
"[131.05s] 右 [main] : He told me that the man of my dreams",
"[134.85s] 右 [main] : Would be just out of reach",
"[137.81s] 右 [main] : Betrothed to another",
"[140.72s] 右 [main] : It's like I hear him now",
"[142.15s] 左 [main] : Hey sis, I want not a sound out of you",
"[145.38s] 右 [main] : It's like I can hear him now",
"[148.30s] 右 [main] : I can hear him now",
"[149.75s] 左 [main] : Um, Bruno",
"[152.32s] 左 [main] : Yeah, about that Bruno",
"[154.23s] 左 [main] : I really need to know about Bruno",
"[156.36s] 左 [main] : Gimme the truth and the whole truth, Bruno",
"[158.42s] 左 [bg] : Isabela, your boyfriend's here",
"[161.75s] 左 [main] : Time for dinner",
"[163.73s] 右 [main] : Seven-foot frame, rats along his back",
"[164.33s] 右 [bg] : It was my wedding day, it was our wedding day",
"[166.63s] 右 [main] : When he calls your name, it all fades to black",
"[166.63s] 右 [bg] : We were getting ready and there wasn't a cloud in the sky",
"[170.70s] 右 [main] : No clouds allowed in the sky",
"[172.48s] 右 [main] : Yeah, he sees your dreams and feasts on your screams",
"[173.07s] 右 [bg] : Bruno walks in with a mischievous grin",
"[176.81s] 右 [main] : You telling this story or am I?",
"[176.81s] 右 [bg] : Thunder",
"[180.35s] 左 [main] : Óye, Mariano's on his way",
"[182.37s] 右 [main] : Bruno says, "It looks like rain"",
"[182.46s] 右 [bg] : He told me that the man of my dreams would be just out of reach",
"[185.21s] 左 [main] : Why did he tell us?",
"[186.74s] 右 [main] : In doing so, he floods my brain",
"[188.57s] 右 [bg] : Betrothed to another, another",
"[191.10s] 右 [main] : Married in a hurricane",
"[191.10s] 右 [bg] : And I'm fine, and I'm fine, and I'm fine, I'm fine",
"[196.05s] 左 [main] : He's here",
"[196.94s] 左 [main] : Don't talk about Bruno",
"[198.97s] 左 [main] : Why did I talk about Bruno?",
"[201.60s] 左 [main] : Not a word about Bruno",
"[203.22s] 左 [main] : I never shoulda brought up Bruno",
]
`;