@applemusic-like-lyrics/lyric 0.2.4 → 0.3.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 CHANGED
@@ -1,35 +1,36 @@
1
1
  # Lyric parser/writer for AMLL
2
2
 
3
- > 警告:此为个人项目,且尚未完成开发,可能仍有大量问题,所以请勿直接用于生产环境!
3
+ English / [简体中文](./README-CN.md)
4
+
5
+ > Warning: This is a personal project and is still under development. There may still be many issues, so please do not use it directly in production environments!
4
6
 
5
7
  ![AMLL-Lyric](https://img.shields.io/badge/Lyric-%23FB8C84?label=Apple%20Music-like%20Lyrics&labelColor=%23FB5C74)
6
8
  [![npm](https://img.shields.io/npm/dt/%40applemusic-like-lyrics/lyric)](https://www.npmjs.com/package/@applemusic-like-lyrics/lyric)
7
9
  [![npm](https://img.shields.io/npm/v/%40applemusic-like-lyrics%2Flyric)](https://www.npmjs.com/package/@applemusic-like-lyrics/lyric)
8
10
 
9
- 一个 AMLL 的歌词解析/生成模块,使用 Rust 编写,并通过 `wasm-pack`
10
- 构建成 WASM 模块以提供给其他项目使用。
11
+ A lyric parsing/generation module for AMLL, written in Rust and built into a WASM module using `wasm-pack` for use in other projects.
11
12
 
12
- 本模块由于只着重于歌词内容,所以会丢弃一切和歌词无关的信息,如需获取一个歌词文件中的详细信息(例如歌手)请考虑使用其他框架。
13
+ 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.
13
14
 
14
- 歌词格式支持表:
15
+ Lyric format support table:
15
16
 
16
- | 源格式\目标格式 | 解析自身格式 | LyRiC 格式 `.lrc` | ESLyric 逐词歌词格式 `.lrc` | 网易云音乐逐词歌词格式 `.yrc` | QQ 音乐逐词歌词格式 `.qrc` | Lyricify Syllable 逐词歌词格式 `.lys` | TTML 歌词格式 `.ttml` | ASS 字幕格式 `.ass` |
17
- | ------------------------------------- | ------------ | ----------------- | --------------------------- | ----------------------------- | -------------------------- | ------------------------------------- | --------------------- | ------------------- |
18
- | LyRiC 格式 `.lrc` | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
19
- | ESLyric 逐词歌词格式 `.lrc` | ✅ | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ |
20
- | 网易云音乐逐词歌词格式 `.yrc` | ✅ | ✅ [^1] | ✅ [^1] | / | ✅ | ✅ | ✅ | ✅ |
21
- | QQ 音乐逐词歌词格式 `.qrc` | ✅ | ✅ [^1] | ✅ [^1] | ✅ | / | ✅ | ✅ | ✅ |
22
- | Lyricify Syllable 逐词歌词格式 `.lys` | ✅ | ✅ [^1] | ✅ [^1] | ✅ [^2] | ✅ [^2] | / | ✅ | ✅ |
23
- | TTML 歌词格式 `.ttml` | ✅ | ✅ [^1] | ✅ [^1] | ✅ [^2] | ✅ [^2] | ✅ [^3] | / | ✅ |
24
- | ASS 字幕格式 `.ass` | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | / |
17
+ | Source Format\Target Format | Parse Own Format | LyRiC Format `.lrc` | ESLyric Word-by-word Format `.lrc` | NetEase Cloud Music Word-by-word Format `.yrc` | QQ Music Word-by-word Format `.qrc` | Lyricify Syllable Word-by-word Format `.lys` | TTML Lyric Format `.ttml` | ASS Subtitle Format `.ass` |
18
+ | ------------------------------------- | --------------- | ------------------- | ---------------------------------- | --------------------------------------------- | ---------------------------------- | -------------------------------------------- | ------------------------ | -------------------------- |
19
+ | LyRiC Format `.lrc` | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
20
+ | ESLyric Word-by-word Format `.lrc` | ✅ | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ |
21
+ | NetEase Cloud Music Word-by-word Format `.yrc` | ✅ | ✅ [^1] | ✅ [^1] | / | ✅ | ✅ | ✅ | ✅ |
22
+ | QQ Music Word-by-word Format `.qrc` | ✅ | ✅ [^1] | ✅ [^1] | ✅ | / | ✅ | ✅ | ✅ |
23
+ | Lyricify Syllable Word-by-word Format `.lys` | ✅ | ✅ [^1] | ✅ [^1] | ✅ [^2] | ✅ [^2] | / | ✅ | ✅ |
24
+ | TTML Lyric Format `.ttml` | ✅ | ✅ [^1] | ✅ [^1] | ✅ [^2] | ✅ [^2] | ✅ [^3] | / | ✅ |
25
+ | ASS Subtitle Format `.ass` | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | / |
25
26
 
26
- [^1]: 会丢失逐词时间数据、演唱属性(背景人声,对唱人声)和 AMLL 元数据
27
- [^2]: 会丢失演唱属性(背景人声,对唱人声)和 AMLL 元数据
28
- [^3]: 会丢失 AMLL 元数据
27
+ [^1]: Will lose word-by-word timing data, vocal attributes (background vocals, duet vocals) and AMLL metadata
28
+ [^2]: Will lose vocal attributes (background vocals, duet vocals) and AMLL metadata
29
+ [^3]: Will lose AMLL metadata
29
30
 
30
- ## Core 歌词组件一起使用
31
+ ## Using with Core Lyric Component
31
32
 
32
- 在和二者合用的时候,需要注意**两者的歌词行结构并不完全相同**,需要进行诸如(以 LyRiC 举例)下面的方式进行转换方可被歌词组件正确解析:
33
+ When using them together, note that **the lyric line structures of the two are not exactly the same**. You need to convert them in a way like the following example (using LyRiC as an example) for the lyric component to parse correctly:
33
34
 
34
35
  ```typescript
35
36
  import { parseLrc } from "@applemusic-like-lyrics/lyric";
@@ -49,12 +50,12 @@ const converted = lines.map((line, i, lines) => ({
49
50
  isBG: false,
50
51
  isDuet: false,
51
52
  }));
52
- // 此时就可以将 converted 传给 LyricPlayer
53
+ // Now you can pass converted to LyricPlayer
53
54
  ```
54
55
 
55
- 推荐使用 TypeScript,这样可以更方便地查错。
56
+ Using TypeScript is recommended as it makes it easier to detect errors.
56
57
 
57
- ## 构建
58
+ ## Building
58
59
 
59
60
  ```shell
60
61
  wasm-pack build --target bundler --release --scope applemusic-like-lyrics
package/package.json CHANGED
@@ -4,8 +4,13 @@
4
4
  "SteveXMH <39523898+Steve-xmh@users.noreply.github.com>"
5
5
  ],
6
6
  "description": "一个歌词解析/生成模块,着重于歌词内容解析,支持多种格式",
7
- "version": "0.2.4",
7
+ "version": "0.3.0",
8
8
  "license": "GPL-3.0",
9
+ "nx": {
10
+ "tags": [
11
+ "library"
12
+ ]
13
+ },
9
14
  "repository": {
10
15
  "type": "git",
11
16
  "url": "https://github.com/Steve-xmh/applemusic-like-lyrics"
@@ -1,13 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * When the `console_error_panic_hook` feature is enabled, we can call the
5
- * `set_panic_hook` function at least once during initialization, and then
6
- * we will get better error messages if our code ever panics.
7
- *
8
- * For more details see
9
- * https://github.com/rustwasm/console_error_panic_hook#readme
10
- */
4
+ * When the `console_error_panic_hook` feature is enabled, we can call the
5
+ * `set_panic_hook` function at least once during initialization, and then
6
+ * we will get better error messages if our code ever panics.
7
+ *
8
+ * For more details see
9
+ * https://github.com/rustwasm/console_error_panic_hook#readme
10
+ */
11
11
  export function wasm_start(): void;
12
12
  /**
13
13
  * 解析 LyRiC 格式的歌词字符串
@@ -102,6 +102,8 @@ export interface LyricWord {
102
102
  endTime: number;
103
103
  /** 单词 */
104
104
  word: string;
105
+ /** 单词的音译 */
106
+ romanWord: string;
105
107
  }
106
108
 
107
109
  /**
package/pkg/amll_lyric.js CHANGED
@@ -1,7 +1,5 @@
1
-
2
1
  import * as wasm from "./amll_lyric_bg.wasm";
2
+ export * from "./amll_lyric_bg.js";
3
3
  import { __wbg_set_wasm } from "./amll_lyric_bg.js";
4
4
  __wbg_set_wasm(wasm);
5
- export * from "./amll_lyric_bg.js";
6
-
7
5
  wasm.__wbindgen_start();