syncalong.pipeline¶
High-level facade that runs the whole lyrics + audio → timestamped result pipeline. This is the entry point most callers want.
pipeline ¶
High-level alignment pipeline: lyrics + audio → timestamped result.
AlignmentResult
dataclass
¶
AlignmentResult(timed_lines: list[tuple[LyricLine, float | None]], lrc: str, matched: int, total: int)
Result of aligning lyrics to an audio file.
Attributes:
| Name | Type | Description |
|---|---|---|
timed_lines |
list[tuple[LyricLine, float | None]]
|
One |
lrc |
str
|
The same alignment rendered as an LRC document. |
matched |
int
|
Number of lines that received a timestamp. |
total |
int
|
Total number of lines. |
align ¶
align(lyrics: LyricsInput, audio: AudioInput, *, transcriber: Transcriber | None = None, model_name: str = 'base', language: str | None = None, use_lyrics_prompt: bool = True, threshold: float = 55.0, separate_vocals: bool = False) -> AlignmentResult
Align lyrics to an audio file and return a structured result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lyrics
|
LyricsInput
|
A :class: |
required |
audio
|
AudioInput
|
Path to the audio file ( |
required |
transcriber
|
Transcriber | None
|
A reusable :class: |
None
|
model_name
|
str
|
Whisper model to load when |
'base'
|
language
|
str | None
|
BCP-47 language code, or |
None
|
use_lyrics_prompt
|
bool
|
Whether to bias Whisper with the lyrics text. |
True
|
threshold
|
float
|
Minimum fuzzy score (0–100) to accept a word match. |
55.0
|
separate_vocals
|
bool
|
When |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
AlignmentResult
|
class: |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
ModuleNotFoundError
|
If |
Source code in src/syncalong/pipeline.py
align_to_lrc ¶
Align lyrics to audio and return just the LRC document.
Convenience wrapper: equivalent to align(lyrics, audio, **kwargs).lrc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lyrics
|
LyricsInput
|
See :func: |
required |
audio
|
AudioInput
|
See :func: |
required |
**kwargs
|
Any
|
Forwarded verbatim to :func: |
{}
|
Returns:
| Type | Description |
|---|---|
str
|
The LRC document as a string. |