pub struct AlignedLyrics {
pub words: Vec<AlignedWord>,
pub lines: Vec<AlignedLine>,
pub waveform_data: Vec<f64>,
pub hoot_cer: Option<f64>,
pub is_streamed: Option<bool>,
}Expand description
A clip’s aligned lyrics: the flat word list and the line list.
Both are empty for an instrumental or an un-alignable clip; see
is_empty.
Fields§
§words: Vec<AlignedWord>§lines: Vec<AlignedLine>§waveform_data: Vec<f64>waveform_data: the amplitude/peak envelope Suno returns for waveform
display, empty when absent. Additive metadata, not lyric content, so it
does not affect is_empty.
hoot_cer: Option<f64>hoot_cer: Suno’s alignment/transcription error metric (higher is
worse), None when absent.
is_streamed: Option<bool>is_streamed: Suno’s streaming flag, None when absent.
Implementations§
Source§impl AlignedLyrics
impl AlignedLyrics
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True when the clip carries no aligned lyrics (an instrumental, or a clip Suno could not align). No synced artefact is written for such a clip.
Sourcepub fn plain_text(&self) -> String
pub fn plain_text(&self) -> String
The plain lyric text, one line per aligned line (falling back to the flat
word list when there are no lines), for the unsynced LYRICS/USLT tag.
Returns an empty string when there is nothing to embed.
Sourcepub fn lrc_body(&self) -> String
pub fn lrc_body(&self) -> String
The body of a standard (line-level) .lrc: one [mm:ss.xx] stamp per
aligned line, followed by the line text.
Line-level is the universally supported LRC form, so every player syncs
and displays it cleanly; the enhanced “A2” per-word <mm:ss.xx> tags are
parsed by only a few karaoke players and are shown as literal text by the
rest, so they are not emitted here. Word-level timing is carried instead
in the MP3 SYLT frame (see sylt_entries). A line
with empty text falls back to its nested words joined by spaces. Structural
section labels ([Chorus], [Verse 1]) are omitted (see
[is_section_label]); they are never sung, so a timed stamp would
highlight a non-lyric line. They are kept in the untimed
plain_text. The body is empty when there are no
lines; callers treat that as “no .lrc”.
Sourcepub fn sylt_entries(&self) -> Vec<(u32, String)>
pub fn sylt_entries(&self) -> Vec<(u32, String)>
Word-level SYLT content: (offset_ms, text) pairs in time order.
Each new line’s first word carries a leading newline so a player renders
line breaks (the ID3v2 SYLT convention). Uses Suno’s own line grouping;
a line with no nested words contributes its whole text as one segment.
Structural section labels ([Chorus], [Verse 1]) are skipped (see
[is_section_label]), matching the .lrc body. The leading newline tracks
the first emitted segment, not the line index, so skipping a label at the
start (or between lines) never leaves a stray or missing break.
Trait Implementations§
Source§impl Clone for AlignedLyrics
impl Clone for AlignedLyrics
Source§fn clone(&self) -> AlignedLyrics
fn clone(&self) -> AlignedLyrics
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AlignedLyrics
impl Debug for AlignedLyrics
Source§impl Default for AlignedLyrics
impl Default for AlignedLyrics
Source§fn default() -> AlignedLyrics
fn default() -> AlignedLyrics
Source§impl PartialEq for AlignedLyrics
impl PartialEq for AlignedLyrics
Source§fn eq(&self, other: &AlignedLyrics) -> bool
fn eq(&self, other: &AlignedLyrics) -> bool
self and other values to be equal, and is used by ==.