@applemusic-like-lyrics/lyric 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -14
- package/dist/amll-lyric.cjs +717 -218
- package/dist/amll-lyric.cjs.map +1 -1
- package/dist/amll-lyric.d.cts +278 -131
- package/dist/amll-lyric.d.mts +278 -131
- package/dist/amll-lyric.mjs +714 -219
- package/dist/amll-lyric.mjs.map +1 -1
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ English / [简体中文](./README-CN.md)
|
|
|
4
4
|
|
|
5
5
|
This is a refactored version of the original lyrics pack. Docs not finished yet.
|
|
6
6
|
|
|
7
|
-
Below is the original docs.
|
|
7
|
+
Below is the original docs. See also: [AMLL Docs](https://amll.dev/en/reference/lyric.html).
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -18,23 +18,56 @@ A lyric parsing/generation module for AMLL, written entirely in TypeScript.
|
|
|
18
18
|
|
|
19
19
|
Since this module focuses only on lyric content, it discards all information unrelated to lyrics. If you need to get detailed information from a lyric file (such as artist), please consider using other frameworks.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
### Parse and generation support
|
|
22
|
+
|
|
23
|
+
| Format | Common extension | Parse | Generate |
|
|
24
|
+
| -------------------------------- | ---------------- | ----- | -------- |
|
|
25
|
+
| **LyRiC** | `.lrc` | ✅ | ✅ |
|
|
26
|
+
| **LRC A2** (enhanced LRC) | `.lrc` | ✅ | ✅ |
|
|
27
|
+
| **ESLyric word-by-word lyrics** | `.lrc` | ✅ | ✅ |
|
|
28
|
+
| **Salt Player Lyrics (SPL)** | `.spl` | ✅ | ✅ |
|
|
29
|
+
| **NetEase word-by-word lyrics** | `.yrc` | ✅ | ✅ |
|
|
30
|
+
| **QQ Music word-by-word lyrics** | `.qrc` | ✅ | ✅ |
|
|
31
|
+
| **Lyricify Syllable** | `.lys` | ✅ | ✅ |
|
|
32
|
+
| **Lyricify Lines** | `.lyl` | ✅ | ✅ |
|
|
33
|
+
| **Lyricify Quick Export** | `.lqe` | ✅ | ✅ |
|
|
34
|
+
| **TTML** | `.ttml` | ✅ | ✅ |
|
|
35
|
+
| **ASS** | `.ass` | ❌ | ✅ |
|
|
22
36
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### Format capability support
|
|
40
|
+
|
|
41
|
+
Each format has different syntax rules, so the lyric capabilities it supports, such as word-level timing, translations, and vocal-part information, also differ:
|
|
42
|
+
|
|
43
|
+
| Format | Timing granularity | Translation / transliteration | Duet | Background vocals | Metadata |
|
|
44
|
+
| ---------------------------------- | ------------------ | ----------------------------------- | ---- | ---------------------- | -------- |
|
|
45
|
+
| **LyRiC (`.lrc`)** | Line-level | ⚠️ Written as additional lyric lines | ❌ | ⚠️ Text wrapped in `()` | ❌ |
|
|
46
|
+
| **LRC A2 (`.lrc`)** | Word-level | ⚠️ Written as additional lyric lines | ❌ | ⚠️ Text wrapped in `()` | ❌ |
|
|
47
|
+
| **ESLyric (`.lrc`)** | Word-level | ⚠️ Written as additional lyric lines | ❌ | ⚠️ Text wrapped in `()` | ❌ |
|
|
48
|
+
| **SPL (`.spl`)** | Word-level | ⚠️ Written as additional lyric lines | ❌ | ⚠️ Text wrapped in `()` | ✅ |
|
|
49
|
+
| **NetEase (`.yrc`)** | Character-level | ❌ | ❌ | ⚠️ Text wrapped in `()` | ❌ |
|
|
50
|
+
| **QQ Music (`.qrc`)** | Character-level | ❌ | ❌ | ⚠️ Text wrapped in `()` | ❌ |
|
|
51
|
+
| **Lyricify Syllable (`.lys`)** | Word-level | ❌ | ✅ | ✅ | ❌ |
|
|
52
|
+
| **Lyricify Lines (`.lyl`)** | Line-level | ❌ | ❌ | ⚠️ Text wrapped in `()` | ❌ |
|
|
53
|
+
| **Lyricify Quick Export (`.lqe`)** | Word-level | ✅ | ✅ | ✅ | ❌ |
|
|
54
|
+
| **TTML (`.ttml`)** | Word-level | ✅ | ✅ | ✅ | ✅ |
|
|
55
|
+
| **ASS (`.ass`)** | Word-level | ❌ | ❌ | ⚠️ Text wrapped in `()` | ❌ |
|
|
56
|
+
|
|
57
|
+
---
|
|
32
58
|
|
|
33
|
-
|
|
59
|
+
### Conversion and degradation rules
|
|
34
60
|
|
|
35
|
-
|
|
61
|
+
When converting between formats through AMLL's internal structure, the following degradation rules apply when the target format lacks a capability provided by the source format:
|
|
36
62
|
|
|
37
|
-
|
|
63
|
+
1. **Word-level timing degradation**: When the target format only supports line-level lyrics, such as LyRiC `.lrc` and Lyricify Lines `.lyl`, word-level timestamps are stripped and all words on a line are merged into a single line.
|
|
64
|
+
2. **Translation and transliteration degradation**:
|
|
65
|
+
* When exporting to an LRC-family format (LyRiC, LRC A2, ESLyric, or SPL), translations and transliterations are inserted as additional lyric lines with the main line's timestamp.
|
|
66
|
+
* When exporting to word-level formats other than TTML (YRC, QRC, LYS, or LYL), translations and transliterations are discarded.
|
|
67
|
+
3. **Background vocals**: When the target format has no native background-vocal marker, background vocals are written with parentheses around the lyric text: `(...)`.
|
|
68
|
+
4. **Duet attributes**: Only LYS, LQE, and TTML preserve duet information. It is lost when exporting to other formats.
|
|
69
|
+
5. **Metadata**: To preserve metadata when exporting to SPL, pass the complete parse result containing metadata to `stringifySPL`. Metadata is written as `[key:value]` tag lines, and keys are converted to lowercase when parsed again. Formats other than TTML and SPL do not support metadata.
|
|
70
|
+
6. **Timestamp precision loss**: ASS karaoke effects use centiseconds (1 cs), so exporting from a millisecond-based format to ASS rounds timestamps and may lose up to 10 milliseconds of precision.
|
|
38
71
|
|
|
39
72
|
## Using with Core Lyric Component
|
|
40
73
|
|