卡拉OK歌詞同步格式完全解析:LRC / KRC / KSC 技術規格
市面上的卡拉OK歌詞格式大多以純文本為基礎,語法並不複雜——但各格式之間的細節差異,對開發者和進階用戶來說卻很重要。
本文詳細解析 LRC、KRC、KSC 三種主流格式的技術規格、語法範例、播放器支援,及在自己的應用中整合這些格式的方式。
LRC 格式技術規格
基本語法
LRC(.lrc)是最廣泛支援的卡拉OK歌詞格式,由純 ASCII 文本構成。
時間標記格式:
[MM:SS.xx]歌詞文字
MM= 分鐘(兩位數)SS= 秒(兩位數)xx= 百分之一秒(hundredths)
範例:
[00:12.00]夜空中最亮的星
[00:15.52]能否聽清楚
[00:18.84]那仰望的人
[00:22.15]心底的孤獨
元數據標記(Metadata Tags)
LRC 支援在文件開頭加入元數據:
[ti:歌曲標題]
[ar:演唱者]
[al:專輯名稱]
[au:歌詞作者]
[length:歌曲長度]
[by:LRC製作者]
[offset:時間偏移毫秒]
增強 LRC(Enhanced LRC)
增強版支援字級時間標記(Word-level timing):
[01:00.00]<01:00.00>我 <01:00.50>愛 <01:01.00>你
格式:[行時間] <字1開始> 字1文本 <字2開始> 字2文本 ...
注意: 增強 LRC 的支援不如標準 LRC 廣泛,部分播放器只識別標準格式。
多時間標記(Repeat Lines)
同一行歌詞可以對應多個時間點(副歌重複):
[00:30.00][01:15.00][02:00.00]重複的副歌歌詞
播放器相容性
| 播放器 | 標準 LRC | 增強 LRC | |--------|---------|---------| | VLC | ✅ | ❌ | | Winamp | ✅ | ✅ | | PowerAMP(Android) | ✅ | ✅ | | iOS Music App | ❌ | ❌ | | Cs Music(iOS) | ✅ | ✅ | | foobar2000 | ✅(插件) | ✅(插件) |
文件編碼
推薦使用 UTF-8(支援中文字符),部分舊播放器需要 GBK 編碼(簡體中文歌詞)或 Big5(繁體中文)。
KRC 格式技術規格
KRC 是酷狗音樂(Kugou)的專有格式,支援字級高亮和顏色漸進效果。
文件結構
KRC 文件為二進制壓縮格式(非純文本):
文件結構:
- 文件頭(Magic bytes):krc1(4 bytes)
- 加密 key(4 bytes)
- 壓縮後的歌詞數據(ZLIB 壓縮)
解壓後的歌詞語法
解壓後的內容為純文本,時間標記語法如下:
[偏移毫秒,持續毫秒]<字1開始ms,字1持續ms,0>字1文字<字2開始ms,字2持續ms,0>字2文字
範例:
[12000,3520]<0,500,0>夜<500,500,0>空<1000,500,0>中<1500,500,0>最<2000,500,0>亮<2500,500,0>的<3000,520,0>星
- 第一個
[12000,3520]:這行從 12,000ms 開始,持續 3,520ms <0,500,0>:第一個字從行開始後 0ms 開始,持續 500ms- 第三個參數(0)目前通常為 0,原意是 rotation/effect
讀取 KRC 的方法(Python 示例)
import zlib
def decode_krc(file_path):
with open(file_path, 'rb') as f:
data = f.read()
# 跳過文件頭 4 bytes('krc1')和 key 4 bytes
compressed = data[8:]
# XOR 解密 key(酷狗使用固定 key)
key = bytes([0x40, 0x47, 0x61, 0x77, 0x5e, 0x32, 0x74, 0x47, 0x51, 0x36, 0x31, 0x2d, 0xce, 0xd2, 0x6e, 0x69])
decrypted = bytes(b ^ key[i % len(key)] for i, b in enumerate(compressed))
# ZLIB 解壓
lyrics = zlib.decompress(decrypted)
return lyrics.decode('utf-8')
播放器支援
| 平台 | 支援 | |------|------| | 酷狗音樂(Kugou) | ✅ 原生 | | 酷我音樂 | ✅ | | 其他播放器 | ❌ 需轉換 |
KSC 格式技術規格
KSC 是相對簡單的格式,語法接近標準 LRC,但使用毫秒作為時間單位。
基本語法
[毫秒]歌詞文字
範例:
[12000]夜空中最亮的星
[15520]能否聽清楚
[18840]那仰望的人
特點
- 純文本格式,易於解析
- 時間精確到毫秒,比 LRC 的百分之一秒更精確(1ms vs 10ms)
- 無字級時間標記
- 適合嵌入較老舊系統
文件編碼
通常為 UTF-8 或 GBK。
格式轉換
LRC → KSC
import re
def lrc_to_ksc(lrc_text):
lines = lrc_text.strip().split('\n')
result = []
for line in lines:
match = re.match(r'\" class="text-sky-400 underline underline-offset-2 hover:text-sky-300" target="_blank" rel="noopener noreferrer">(\d{2}):(\d{2})\.(\d{2})\', line)
if match:
m, s, cs, text = match.groups()
ms = int(m) 60000 + int(s) 1000 + int(cs) 10
result.append(f'[{ms}]{text}')
return '\n'.join(result)
LRC 解析(JavaScript 示例)
function parseLRC(text) {
const lines = text.split('\n');
const result = [];
for (const line of lines) {
const match = line.match(/\" class="text-sky-400 underline underline-offset-2 hover:text-sky-300" target="_blank" rel="noopener noreferrer">(\d{2}):(\d{2})\.(\d{2,3})\/);
if (match) {
const [, m, s, cs, text] = match;
const timeMs = parseInt(m) 60000 + parseInt(s) 1000 + parseInt(cs) (cs.length === 2 ? 10 : 1);
result.push({ timeMs, text: text.trim() });
}
}
return result.sort((a, b) => a.timeMs - b.timeMs);
}
singkla.com 的歌詞生成
singkla.com 同時生成三種格式(LRC / KRC / KSC),底層使用語音識別模型(Whisper 及相關模型)配合時間標記對齊,特別針對粵語和普通話做了語言優化。
如果你在開發卡拉OK相關應用,三種格式都可以在 singkla.com 免費生成作為測試素材:
👉 singkla.com — 免費生成 LRC/KRC/KSC 歌詞
相關資源
- LRC 格式規範(非官方):多個實作的彙整文檔
- Demucs(音頻分離):https://github.com/facebookresearch/demucs
- Whisper(語音識別):https://github.com/openai/whisper
- KRC 格式解析:多個開源項目已實作(可搜尋
krc decoderGitHub)
體驗「音樂時光機」的魅力
如果你是在籌備一場派對,絕對不能錯過我們獨家推出的「音樂時光機」功能!這不僅僅是一個去人聲工具,它能讓你自由調整原唱的音量比例。你可以保留一點點原唱作為「導唱」,就像回到 90 年代 KTV 包廂裡的感覺,讓所有賓客都能無壓力地跟著唱,是炒熱氣氛的絕佳秘密武器!
結語與設備推薦
好的伴奏需要搭配好的設備才能完美呈現。如果你打算錄製自己的翻唱作品,或是希望在派對上有更好的收音效果,我們強烈推薦使用 BOYA 專業麥克風。它以極高的性價比深受眾多創作者喜愛。
👉 點擊這裡前往 Amazon 選購 BOYA 麥克風並查看最新優惠!
🎙️ 錄音裝備推薦:提升你的翻唱音質
如果你想將剛下載的伴奏錄製成完美的 Cover,一支好的麥克風是必不可少的!我們推薦使用 BOYA 專業收音設備,它具有極高的性價比,無論是手機還是電腦錄音都能輕鬆駕馭。
👉 專享 BOYA 全線產品 10% 優惠折扣,立即升級你的錄音裝備!
Complete Technical Guide to Karaoke Lyrics Sync Formats: LRC, KRC, and KSC Specifications
A deep dive into the technical specifications of LRC, KRC, and KSC karaoke lyrics sync formats — including timestamp syntax, player compatibility, and developer integration. For technical users and developers.
LRC (.lrc) — The Universal Standard
Basic Syntax
LRC (.lrc) is the most widely supported karaoke lyrics format, composed of plain ASCII text.
Timestamp format:
[MM:SS.xx]Lyrics text here
MM= Minutes (two digits)SS= Seconds (two digits)xx= Hundredths of a second
Example:
[00:12.00]The brightest star in the night sky
[00:15.52]Can you hear clearly
[00:18.84]The person looking up
[00:22.15]The loneliness in their heart
Metadata Tags
LRC supports adding metadata at the beginning of the file:
[ti:Song Title]
[ar:Artist]
[al:Album]
[au:Lyricist]
[length:Song Length]
[by:LRC Creator]
[offset:Time offset in milliseconds]
Enhanced LRC
Enhanced LRC supports word-level timing:
[01:00.00]<01:00.00>I <01:00.50>love <01:01.00>you
Format: [Line time]
Note: Enhanced LRC support is not as widespread as standard LRC; some players only recognize the standard format.
Repeat Lines
The same lyric line can correspond to multiple timestamps (for repeating choruses):
[00:30.00][01:15.00][02:00.00]Repeating chorus lyrics
Player Compatibility
| Player | Standard LRC | Enhanced LRC | |--------|---------|---------| | VLC | ✅ | ❌ | | Winamp | ✅ | ✅ | | PowerAMP (Android) | ✅ | ✅ | | iOS Music App | ❌ | ❌ | | Cs Music (iOS) | ✅ | ✅ | | foobar2000 | ✅ (plugin) | ✅ (plugin) |
File Encoding
UTF-8 is recommended (supports Chinese characters). Some older players may require GBK encoding (for Simplified Chinese lyrics) or Big5 (for Traditional Chinese).
KRC (.krc) — Kugou's Proprietary Format
KRC is Kugou Music's proprietary format, supporting word-level highlighting and color gradient effects.
File Structure
KRC files are in a binary compressed format (not plain text):
File Structure:
- File header (Magic bytes): krc1 (4 bytes)
- Encryption key (4 bytes)
- Compressed lyrics data (ZLIB compressed)
Decompressed Lyric Syntax
The decompressed content is plain text, with the following timestamp syntax:
[offset_ms,duration_ms]<char1_start_ms,char1_duration_ms,0>Char1_text<char2_start_ms,char2_duration_ms,0>Char2_text
Example:
[12000,3520]<0,500,0>The<500,500,0>brightest<1000,500,0>star<1500,500,0>in<2000,500,0>the<2500,500,0>night<3000,520,0>sky
- The first
[12000,3520]: This line starts at 12,000ms and lasts for 3,520ms. <0,500,0>: The first character starts 0ms after the line begins and lasts for 500ms.- The third parameter (0) is currently usually 0; its original intent was for rotation/effects.
Method to Read KRC (Python Example)
import zlib
def decode_krc(file_path):
with open(file_path, 'rb') as f:
data = f.read()
# Skip file header 4 bytes ('krc1') and key 4 bytes
compressed = data[8:]
# XOR decryption key (Kugou uses a fixed key)
key = bytes([0x40, 0x47, 0x61, 0x77, 0x5e, 0x32, 0x74, 0x47, 0x51, 0x36, 0x31, 0x2d, 0xce, 0xd2, 0x6e, 0x69])
decrypted = bytes(b ^ key[i % len(key)] for i, b in enumerate(compressed))
# ZLIB decompression
lyrics = zlib.decompress(decrypted)
return lyrics.decode('utf-8')
Player Support
| Platform | Support | |----------|---------| | Kugou Music | ✅ Native | | Kuwo Music | ✅ | | Other Players | ❌ Requires conversion |
KSC (.ksc) — Simple Millisecond Format
KSC is a relatively simple format, with syntax similar to standard LRC but using milliseconds as the time unit.
Basic Syntax
[milliseconds]Lyrics text
Example:
[12000]The brightest star in the night sky
[15520]Can you hear clearly
[18840]The person looking up
Features
- Plain text format, easy to parse
- Time accurate to milliseconds, more precise than LRC's hundredths of a second (1ms vs 10ms)
- No word-level timing
- Suitable for embedding in older systems
File Encoding
Usually UTF-8 or GBK.
Format Conversion
LRC → KSC
import re
def lrc_to_ksc(lrc_text):
lines = lrc_text.strip().split('\n')
result = []
for line in lines:
match = re.match(r'\" class="text-sky-400 underline underline-offset-2 hover:text-sky-300" target="_blank" rel="noopener noreferrer">(\d{2}):(\d{2})\.(\d{2})\', line)
if match:
m, s, cs, text = match.groups()
ms = int(m) 60000 + int(s) 1000 + int(cs) 10
result.append(f'[{ms}]{text}')
return '\n'.join(result)
LRC Parsing (JavaScript Example)
function parseLRC(text) {
const lines = text.split('\n');
const result = [];
for (const line of lines) {
const match = line.match(/\" class="text-sky-400 underline underline-offset-2 hover:text-sky-300" target="_blank" rel="noopener noreferrer">(\d{2}):(\d{2})\.(\d{2,3})\/);
if (match) {
const [, m, s, cs, text] = match;
const timeMs = parseInt(m) 60000 + parseInt(s) 1000 + parseInt(cs) (cs.length === 2 ? 10 : 1);
result.push({ timeMs, text: text.trim() });
}
}
return result.sort((a, b) => a.timeMs - b.timeMs);
}
singkla.com Lyrics Generation
singkla.com simultaneously generates all three formats (LRC / KRC / KSC) using speech recognition models (Whisper and related models) for timestamp alignment, with specific language optimization for Cantonese and Mandarin.
If you are developing karaoke-related applications, all three formats can be generated for free on singkla.com as test material:
👉 singkla.com — Free LRC/KRC/KSC Generator
Related Resources
- LRC Format Specification (unofficial): A compilation of multiple implementations
- Demucs (Audio Separation): https://github.com/facebookresearch/demucs
- Whisper (Speech Recognition): https://github.com/openai/whisper
- KRC Format Parsing: Implemented by multiple open-source projects (search
krc decoderon GitHub)
Experience the Charm of the "Music Time Machine"
If you are planning a party, you absolutely cannot miss our exclusive "Music Time Machine" feature! It's more than just a vocal removal tool; it allows you to freely adjust the volume ratio of the original vocals. You can keep a little bit of the original voice as a "guide track," recreating that nostalgic 90s karaoke booth feeling. This allows all your guests to sing along without pressure, making it the ultimate secret weapon to hype up the party!
Conclusion and Equipment Recommendation
A good backing track needs to be paired with good equipment for a perfect presentation. If you plan to record your own covers or want better audio pickup at your party, we highly recommend BOYA professional microphones. They are beloved by many creators for their extremely high cost-performance ratio.
👉 Click here to shop BOYA microphones on Amazon and check out the latest offers!
🎙️ Recording Gear Recommendation: Elevate Your Cover Song Quality
If you want to record a perfect cover with the backing track you just downloaded, a good microphone is essential! We recommend BOYA professional audio equipment for its excellent cost-performance ratio, easily compatible with both mobile and computer recording.
👉 Get an exclusive 10% discount on all BOYA products and upgrade your recording gear now!