from lyric_timestamp_mapper import LyricTimestampMapper

API_KEY = "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"
AUDIO_PATH = "test_audio.mp3"

GROUND_TRUTH_LYRICS = [
    "첫 번째 가사 라인입니다",
    "두 번째 가사 라인입니다",
    "세 번째 가사 라인입니다",
]

mapper = LyricTimestampMapper(api_key=API_KEY)
result = mapper.map_ground_truth(AUDIO_PATH, GROUND_TRUTH_LYRICS)

for lyric in result:
    if lyric.start >= 0:
        print(f"[{lyric.start:.2f} - {lyric.end:.2f}] {lyric.text}")
    else:
        print(f"[매칭 실패] {lyric.text}")
