feat(audio-engine): 增强本地库歌词标签识别兼容性#100
Open
Pissofdvpe wants to merge 1 commit into
Open
Conversation
- 引入归一化标签键读取机制(去除空格、下划线/连字符),解决带空格歌词标签(如 UNSYNCED LYRICS)读取失败问题。 - 扩展前缀匹配能力,支持带语言后缀(如 lyrics-ENG)的多种非常规格式。 - 引入优先级判读逻辑以提升标签识别性。 - 增强单元测试以覆盖各类异常标签键名。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动类型
是否包含破坏性变更
改动说明
本次优化主要针对本地音乐库的内嵌歌词读取功能,提升了对多种音频标签标准(Tag Standards)的兼容性。
使用本地音乐库导入音频文件发现有些音频明明带有歌词但不显示。发现原有的歌词读取逻辑过于单一,仅支持特定的硬编码标签键名(如“lyrics”),导致许多标签工具(如 Mp3tag/music-tag-web/foobar2000 等)写入的格式(如带空格的“UNSYNCED LYRICS”)无法被识别。
而无论 Spotify、Apple Music、Deezer 还是网抑、扣扣甚至是其他野生门路等Down下的资源,大多也存在类似的不同平台和音频格式的歌词标签多样化问题,故此增加对歌词标签的广泛兼容性支持。
主要变更:
lyrics,unsyncedlyrics,syncedlyrics,uslt,sylt,lyricUNSYNCED LYRICS,unsynced_lyrics,SYNCED_LYRICS等lyrics-ENG,unsyncedlyrics-ZHO等native/audio-engine底层,自动将标签键名进行归一化处理(去除空格、下划线、连字符,转小写),实现模糊匹配。max_by_key),统一维护并下沉至lib.rs。关联 Issue
无
测试情况
native/audio-engine下运行cargo test --lib,所有 19 个单元测试均通过。unsyncedlyrics,lyricseng,lyric-eng,unsynced_lyrics等多种变体标签,均能成功读取原始歌词。截图 / 录屏
无
自查清单
pnpm format,并确认pnpm typecheck、pnpm lint通过pnpm build:native验证;未手写native/*/index.d.ts