feat: send word-by-word and translated lyrics to clients

This commit is contained in:
DiheChen committed 2026-11-05 01:03:38 +08:00
1 parent e2364b171e
commit a38d6ca3e2
10 files changed
+71 -11

No files matched your search

+3 -1
View File
@@ -171,7 +171,9 @@
"startedAtMs": {"type": "integer"},
"durationMs": {"type": "integer", "description": "准备结果中的时长"},
"gain": {"type": "number", "description": "线性增益系数"},
"lyric": {"type": "string"}
"lyric": {"type": "string"},
"lyricWords": {"type": "string", "description": "逐字歌词,每行形如 [行起始ms,行时长ms](字起始ms,字时长ms,0)字,时间为绝对毫秒"},
"lyricTrans": {"type": "string", "description": "翻译歌词,行级 LRC,时间戳与原文的行起点对应"}
},
"required": ["entry", "mediaUrl", "startedAtMs", "durationMs", "gain", "lyric"]
},
+9 -1
View File
@@ -631,6 +631,14 @@
"lyric": {
"type": "string"
},
"lyricTrans": {
"description": "翻译歌词,行级 LRC,时间戳与原文的行起点对应",
"type": "string"
},
"lyricWords": {
"description": "逐字歌词,每行形如 [行起始ms,行时长ms](字起始ms,字时长ms,0)字,时间为绝对毫秒",
"type": "string"
},
"mediaUrl": {
"type": "string"
},
@@ -1335,7 +1343,7 @@
},
"info": {
"title": "Alisten",
"version": "09dbf7ea495db969"
"version": "473ee31f5ef912b4"
},
"openapi": "3.1.0",
"paths": {
+3 -1
View File
@@ -4,7 +4,7 @@ package protocol
import "encoding/json"
const Version = "09dbf7ea495db969"
const Version = "473ee31f5ef912b4"
type APIKey struct {
Key string `json:"key"`
@@ -255,6 +255,8 @@ type NowPlaying struct {
Entry Entry `json:"entry"`
Gain float64 `json:"gain"`
Lyric string `json:"lyric"`
LyricTrans *string `json:"lyricTrans,omitempty"`
LyricWords *string `json:"lyricWords,omitempty"`
MediaURL string `json:"mediaUrl"`
StartedAtMs int64 `json:"startedAtMs"`
}