@bbplayer/splash
BBPlayer 歌词解析与转换核心工具库 (BBPlayer Lyrics Parser and Converter Core Library).Introduction
@bbplayer/splash is the core lyrics parsing and conversion engine for BBPlayer. It is built around the SPL (Salt Player Lyric) format, an advanced extension of the LRC format designed to support richer lyric presentation effects including word-by-word timing.
Features
Parsing Capabilities
- Multi-format support: Parse LRC, SPL, and other lyric formats with precision
- Word-level timing: Support for word-by-word (karaoke-style) lyric synchronization
- Translation support: Handle multiple translation lines per lyric line
- Metadata extraction: Parse lyric metadata like title, artist, album, etc.
Conversion Engine
- Netease Cloud Music: Convert YRC format from Netease Cloud Music to SPL format
- LRC to SPL: Convert standard LRC to SPL with enhanced timing capabilities
- Preserve word-level timing: Maintain word-by-word timing data during conversion
Type Safety
- TypeScript-first: Fully typed API with comprehensive type definitions
- Unified data structures: Consistent
SplLyricDatainterface for all parsed lyrics - Error handling: Type-safe error handling with
SplParseError
Performance
- Mobile-optimized: Parsing algorithms optimized for mobile environments
- Efficient parsing: Fast parsing with minimal memory overhead
- Zero dependencies: Core functionality has no runtime dependencies
Installation
Quick Start
Parse LRC Lyrics
Parse SPL with Word-level Timing
Convert Netease YRC to SPL
Core Concepts
SPL Format
SPL (Salt Player Lyric) is an enhanced lyric format that extends LRC with:- Word-level timestamps using
<mm:ss.SSS>tags for karaoke-style display - Multiple translations through repeated timestamps
- Explicit end times for precise timing control
Data Structures
All parsed lyrics return aSplLyricData object:
Next Steps
SPL Format
Learn about the SPL format specification and syntax
API Reference
Explore the complete API documentation