lyrics-transcriber 0.65.1__py3-none-any.whl → 0.68.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@
10
10
  <link rel="icon" type="image/png" sizes="512x512" href="/android-chrome-512x512.png" />
11
11
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
12
12
  <title>Nomad Karaoke: Lyrics Review</title>
13
- <script type="module" crossorigin src="/assets/index-BDSHneNc.js"></script>
13
+ <script type="module" crossorigin src="/assets/index-D7BQUJXK.js"></script>
14
14
  </head>
15
15
  <body>
16
16
  <div id="root"></div>
@@ -21,7 +21,7 @@ class LyricsProviderConfig:
21
21
  lyrics_file: Optional[str] = None
22
22
  cache_dir: Optional[str] = None
23
23
  audio_filepath: Optional[str] = None
24
- max_line_length: int = 36 # New config parameter for KaraokeLyricsProcessor
24
+ max_line_length: int = 36 # Config parameter for KaraokeLyricsProcessor
25
25
 
26
26
 
27
27
  class BaseLyricsProvider(ABC):
@@ -15,6 +15,7 @@ class ScreenConfig:
15
15
  post_roll_time: float = 1.0,
16
16
  fade_in_ms: int = 200,
17
17
  fade_out_ms: int = 300,
18
+ lead_in_color: str = "112, 112, 247", # Default blue color in RGB format
18
19
  ):
19
20
  # Screen layout
20
21
  self.max_visible_lines = max_visible_lines
@@ -27,6 +28,42 @@ class ScreenConfig:
27
28
  self.post_roll_time = post_roll_time
28
29
  self.fade_in_ms = fade_in_ms
29
30
  self.fade_out_ms = fade_out_ms
31
+ # Lead-in configuration
32
+ self.lead_in_color = lead_in_color
33
+
34
+ def get_lead_in_color_ass_format(self) -> str:
35
+ """Convert RGB lead-in color to ASS format.
36
+
37
+ Accepts either:
38
+ - RGB format: "112, 112, 247"
39
+ - ASS format: "&HF77070&" (for backward compatibility)
40
+
41
+ Returns ASS format color string.
42
+ """
43
+ color_str = self.lead_in_color.strip()
44
+
45
+ # If already in ASS format, return as-is
46
+ if color_str.startswith("&H") and color_str.endswith("&"):
47
+ return color_str
48
+
49
+ # Parse RGB format "R, G, B" or "R, G, B, A"
50
+ try:
51
+ parts = [int(x.strip()) for x in color_str.split(",")]
52
+ if len(parts) == 3:
53
+ r, g, b = parts
54
+ a = 255 # Default full opacity
55
+ elif len(parts) == 4:
56
+ r, g, b, a = parts
57
+ else:
58
+ raise ValueError(f"Invalid color format: {color_str}")
59
+
60
+ # Convert to ASS format: &H{alpha}{blue}{green}{red}&
61
+ # Note: alpha is inverted in ASS (255-a)
62
+ return f"&H{255-a:02X}{b:02X}{g:02X}{r:02X}&"
63
+
64
+ except (ValueError, TypeError) as e:
65
+ # Fallback to default blue if parsing fails
66
+ return "&HF77070&"
30
67
 
31
68
 
32
69
  @dataclass
@@ -140,7 +140,7 @@ class LyricsLine:
140
140
  main_text = (
141
141
  f"{{\\an8}}" # center-bottom alignment
142
142
  f"{{\\move(0,{state.y_position + main_height},{text_left},{state.y_position + main_height},0,{move_duration})}}" # Move until line start
143
- f"{{\\c&HF77070&}}" # Same color as karaoke highlight
143
+ f"{{\\c{config.get_lead_in_color_ass_format()}}}" # Configurable lead-in color in ASS format
144
144
  f"{{\\alpha&H4D&}}" # 70% opacity (FF=0%, 00=100%)
145
145
  f"{{\\fad(800,500)}}" # 800ms fade in, 500ms fade out
146
146
  f"{{\\p1}}m {-rect_width} {-rect_height} l 0 {-rect_height} 0 0 {-rect_width} 0{{\\p0}}" # Draw up from bottom
@@ -52,21 +52,31 @@ class OutputGenerator:
52
52
 
53
53
  self.logger.info(f"Initializing OutputGenerator with config: {self.config}")
54
54
 
55
- if self.config.render_video or self.config.generate_cdg:
56
- # Load output styles from JSON
55
+ # Load output styles from JSON if provided
56
+ if self.config.output_styles_json and os.path.exists(self.config.output_styles_json):
57
57
  try:
58
58
  with open(self.config.output_styles_json, "r") as f:
59
59
  self.config.styles = json.load(f)
60
60
  self.logger.debug(f"Loaded output styles from: {self.config.output_styles_json}")
61
61
  except Exception as e:
62
- raise ValueError(f"Failed to load output styles file: {str(e)}")
62
+ if self.config.render_video or self.config.generate_cdg:
63
+ # Only raise error for video/CDG since they require styles
64
+ raise ValueError(f"Failed to load output styles file: {str(e)}")
65
+ else:
66
+ # For other outputs, just log warning and continue with empty styles
67
+ self.logger.warning(f"Failed to load output styles file: {str(e)}")
68
+ self.config.styles = {}
69
+ else:
70
+ # No styles file provided or doesn't exist
71
+ if self.config.render_video or self.config.generate_cdg:
72
+ raise ValueError(f"Output styles file required for video/CDG generation but not found: {self.config.output_styles_json}")
73
+ else:
74
+ self.config.styles = {}
63
75
 
64
76
  # Set video resolution parameters
65
77
  self.video_resolution_num, self.font_size, self.line_height = self._get_video_params(self.config.video_resolution)
66
78
  self.logger.info(f"Video resolution: {self.video_resolution_num}, font size: {self.font_size}, line height: {self.line_height}")
67
79
 
68
- self.segment_resizer = SegmentResizer(max_line_length=self.config.max_line_length, logger=self.logger)
69
-
70
80
  # Initialize generators
71
81
  self.plain_text = PlainTextGenerator(self.config.output_dir, self.logger)
72
82
  self.lyrics_file = LyricsFileGenerator(self.config.output_dir, self.logger)
@@ -100,6 +110,12 @@ class OutputGenerator:
100
110
  self.config.styles["karaoke"]["font_size"] = self.font_size
101
111
  self.logger.info(f"Preview mode: Scaled down font_size to: {self.font_size}")
102
112
 
113
+ # Get max_line_length from styles if available, otherwise use config default
114
+ max_line_length = self.config.styles.get("karaoke", {}).get("max_line_length", self.config.default_max_line_length)
115
+ self.logger.info(f"Using max_line_length: {max_line_length}")
116
+ self.segment_resizer = SegmentResizer(max_line_length=max_line_length, logger=self.logger)
117
+
118
+ if self.config.render_video:
103
119
  # Initialize subtitle generator with potentially scaled values
104
120
  self.subtitle = SubtitlesGenerator(
105
121
  output_dir=self.config.output_dir,
@@ -60,7 +60,8 @@ class SubtitlesGenerator:
60
60
  "screen_gap_threshold",
61
61
  "post_roll_time",
62
62
  "fade_in_ms",
63
- "fade_out_ms"
63
+ "fade_out_ms",
64
+ "lead_in_color"
64
65
  ]
65
66
 
66
67
  for prop in screen_config_props:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lyrics-transcriber
3
- Version: 0.65.1
3
+ Version: 0.68.0
4
4
  Summary: Automatically create synchronised lyrics files in ASS and MidiCo LRC formats with word-level timestamps, using Whisper and lyrics from Genius and Spotify
5
5
  License: MIT
6
6
  Author: Andrew Beveridge
@@ -2,9 +2,9 @@ lyrics_transcriber/__init__.py,sha256=g9ZbJg9U1qo7XzrC25J3bTKcNzzwUJWDVdi_7-hjcM
2
2
  lyrics_transcriber/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  lyrics_transcriber/cli/cli_main.py,sha256=Tk_PtZyAogsPSrmAD8KNQsPMWFW_patX2XM0EZGaVis,10752
4
4
  lyrics_transcriber/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- lyrics_transcriber/core/config.py,sha256=G4Z5kEBMDXRscEiRKbnofAPuFTDB5h1fLJvwxaHaT4I,1268
6
- lyrics_transcriber/core/controller.py,sha256=ZPbOMvVJVke1YlO4CvjDtU2RNQPfRszCEFLn2XjTsuM,22051
7
- lyrics_transcriber/correction/anchor_sequence.py,sha256=IgIuwn6f0EUux9nOb2BKysNC5-gUHXzlNYEZjBsL5io,43330
5
+ lyrics_transcriber/core/config.py,sha256=VvJIjwLpZhCmOBQ4iqpzA2LBoP0AP1uvbzy8OYiyy_M,1276
6
+ lyrics_transcriber/core/controller.py,sha256=Rx4a_gVVChEXMhDzyt6ISGUS5rUY7wIGtijTQlRrESw,23268
7
+ lyrics_transcriber/correction/anchor_sequence.py,sha256=3A9azNA2_iT8iveUmM39RysMQvoZI-YhIjYIn9QZ2ZQ,52850
8
8
  lyrics_transcriber/correction/corrector.py,sha256=wwSLHat4SGKEJffFQVcmSfMN_I8Drv-jpeTkO8ndLu0,20930
9
9
  lyrics_transcriber/correction/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  lyrics_transcriber/correction/handlers/base.py,sha256=ZXYMFgbCmlD62dpqdFwFPlcePdHKEFrABffnG_Mu5mI,1687
@@ -29,7 +29,7 @@ lyrics_transcriber/frontend/README.md,sha256=-D6CAfKTT7Y0V3EjlZ2fMy7fyctFQ4x2TJ9
29
29
  lyrics_transcriber/frontend/__init__.py,sha256=nW8acRSWTjXoRwGqcTU4w-__X7tMAE0iXL0uihBN3CU,836
30
30
  lyrics_transcriber/frontend/eslint.config.js,sha256=3ADH23ANA4NNBKFy6nCVk65e8bx1DrVd_FIaYNnhuqA,734
31
31
  lyrics_transcriber/frontend/index.html,sha256=u1m7042a1kLWZVIElYQ9y-lzfIAdYJGtQE-i4Zjc3xY,806
32
- lyrics_transcriber/frontend/package.json,sha256=gRWkMRmjPpe-ashty2Lw-0HpkkDJ1I_Jqld_dDt_Pis,1182
32
+ lyrics_transcriber/frontend/package.json,sha256=vJu5aHq0dZ0OR7tLyeUnWb3_7mHcDfk2idnv4YRdh_s,1182
33
33
  lyrics_transcriber/frontend/public/android-chrome-192x192.png,sha256=lg-6aPF5mGLiuG7LyftZk_0RI41srmpA8wj-NkaaQms,17632
34
34
  lyrics_transcriber/frontend/public/android-chrome-512x512.png,sha256=x-zuKT3NYsTqAWzhKRTZeD4-0uYoUjqMPZpKTChqNJ8,123447
35
35
  lyrics_transcriber/frontend/public/apple-touch-icon.png,sha256=6y5vGra54w5oc8VP6sn2JjoQtN9hWTKn0YPhmdlmfU0,16188
@@ -92,15 +92,15 @@ lyrics_transcriber/frontend/vite.config.ts,sha256=8FdW0dN8zDFqfhQSxX5h7sIu72X2pi
92
92
  lyrics_transcriber/frontend/web_assets/android-chrome-192x192.png,sha256=lg-6aPF5mGLiuG7LyftZk_0RI41srmpA8wj-NkaaQms,17632
93
93
  lyrics_transcriber/frontend/web_assets/android-chrome-512x512.png,sha256=x-zuKT3NYsTqAWzhKRTZeD4-0uYoUjqMPZpKTChqNJ8,123447
94
94
  lyrics_transcriber/frontend/web_assets/apple-touch-icon.png,sha256=6y5vGra54w5oc8VP6sn2JjoQtN9hWTKn0YPhmdlmfU0,16188
95
- lyrics_transcriber/frontend/web_assets/assets/index-BDSHneNc.js,sha256=WeyaRjupghctbN_fiGWP-p9-jc7AogOikmE_QngOR98,1257981
96
- lyrics_transcriber/frontend/web_assets/assets/index-BDSHneNc.js.map,sha256=vHuwZubKkHgbQ8xLMvY901Ghh7nQAe1gjXOEaLIkv4k,2678510
95
+ lyrics_transcriber/frontend/web_assets/assets/index-D7BQUJXK.js,sha256=SI3DxghjD5pHotjg8B8fLVZIunbiYxiaYsaNklxX0Yk,1257981
96
+ lyrics_transcriber/frontend/web_assets/assets/index-D7BQUJXK.js.map,sha256=OvN5GUn_pvBDt5d4DkHDx5ZC2LjKd5RVPYb_sqnB2yM,2678510
97
97
  lyrics_transcriber/frontend/web_assets/favicon-16x16.png,sha256=2wy_7ZmVS4d7umByJVHQ37DBB_8xrU9xfT1_konSXQI,604
98
98
  lyrics_transcriber/frontend/web_assets/favicon-32x32.png,sha256=6TyrRMIw6G8dpG4_QWVTY8DMxo0bIGzc_9aOJrkiJKM,1297
99
99
  lyrics_transcriber/frontend/web_assets/favicon.ico,sha256=ZK7QvdBuZp0QxPkluCW4IKxfleFmFLp1KkG_d5xmx7E,15406
100
- lyrics_transcriber/frontend/web_assets/index.html,sha256=PUBsJDWgmH5Z7kxr2weXCgUOIwHxl4kpdx0zp5Z_GT4,830
100
+ lyrics_transcriber/frontend/web_assets/index.html,sha256=CfkXg3EEY8YzZ4KIKIh-9_t6yxg7cxweaky2SPry1VM,830
101
101
  lyrics_transcriber/frontend/web_assets/nomad-karaoke-logo.png,sha256=jTTBFXV6hGJGolZYQ-dIjgQQbMsehk5XGtsllhLrdzg,212641
102
102
  lyrics_transcriber/frontend/yarn.lock,sha256=wtImLsCO1P1Lpkhc1jAN6IiHQ0As4xn39n0cwKoh4LM,131996
103
- lyrics_transcriber/lyrics/base_lyrics_provider.py,sha256=LCzmwpBFgSfC6VVY5AtJHmE0OvgjAQyjPnL-dYLLwg4,9172
103
+ lyrics_transcriber/lyrics/base_lyrics_provider.py,sha256=SskR5RIKorLcHhNSpHV35_kCnSA027_OOO9E45Jbv88,9168
104
104
  lyrics_transcriber/lyrics/file_provider.py,sha256=WNd6mHMV2FhrnHiWBvxUxPkdVi47mbLE4hXaTYqStTM,4290
105
105
  lyrics_transcriber/lyrics/genius.py,sha256=XTKLAjwzopYIOvvn0na_Ym5yM1JZjp8a-f1Ebr4cuN0,17121
106
106
  lyrics_transcriber/lyrics/musixmatch.py,sha256=mlTuRm7XxeXy1NAHqqLUhilf90IY0JiGdX9nAmiZ2M0,7368
@@ -110,11 +110,11 @@ lyrics_transcriber/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
110
110
  lyrics_transcriber/output/ass/__init__.py,sha256=EYQ45gI7_-vclVgzISL0ML8VgxCdB0odqEyPyiPCIw0,578
111
111
  lyrics_transcriber/output/ass/ass.py,sha256=xHId7Rv5gqmdQ7ZrWQSy46JX7vZcB_BzpZC800DwQk8,74315
112
112
  lyrics_transcriber/output/ass/ass_specs.txt,sha256=r80HVXWSjTMGU7o2NOJdHkYNBY6SVwSVf0Dyslc1OXk,39288
113
- lyrics_transcriber/output/ass/config.py,sha256=qnjZnAN4KNoQB6v9l6sCvVXuZei56sPKEsuoTayN_0A,1255
113
+ lyrics_transcriber/output/ass/config.py,sha256=7axeOhArzUa1J58CA-xANq7Mp8KFmkugUoWg6gcn594,2669
114
114
  lyrics_transcriber/output/ass/constants.py,sha256=CUxR7K3LnoZeA7WMuMYMAPto0J7VW3IwKlP_Ve7XB0A,536
115
115
  lyrics_transcriber/output/ass/event.py,sha256=XVbA7YR6WgFa5ynrgE2R7ngauWZVZyNn86BfyNLF0u8,2657
116
116
  lyrics_transcriber/output/ass/formatters.py,sha256=hx_3a1goRIVQwAeNyu9n4UZcnpO9vm87x1aiHK5TBRc,3614
117
- lyrics_transcriber/output/ass/lyrics_line.py,sha256=WIOhNzBg4b29xL-7qklQzvyfPdWS1_LX_RYa84jz5wc,9480
117
+ lyrics_transcriber/output/ass/lyrics_line.py,sha256=3HI5H5iupr-H0p9GznqriiogpQnAewsq9JPJycABv-g,9519
118
118
  lyrics_transcriber/output/ass/lyrics_screen.py,sha256=gRzUsDMLEtZZPuv77xk7M0FzCpFph5tjlE5hhFaobOw,10676
119
119
  lyrics_transcriber/output/ass/section_detector.py,sha256=TsSf4E0fleC-Tzd5KK6q4m-wjGiu6TvGDtHdR6sUqvc,3922
120
120
  lyrics_transcriber/output/ass/section_screen.py,sha256=QeUaIeDXs_Es33W5aqyVSaZzMwUx-b60vbAww3aQfls,4185
@@ -149,12 +149,12 @@ lyrics_transcriber/output/fonts/Zurich_Cn_BT_Bold.ttf,sha256=WNG5LOQ-uGUF_WWT5aQ
149
149
  lyrics_transcriber/output/fonts/arial.ttf,sha256=NcDzVZ2NtWnjbDEJW4pg1EFkPZX1kTneQOI_ragZuDM,275572
150
150
  lyrics_transcriber/output/fonts/georgia.ttf,sha256=fQuyDGMrtZ6BoIhfVzvSFz9x9zIE3pBY_raM4DIicHI,142964
151
151
  lyrics_transcriber/output/fonts/verdana.ttf,sha256=lu0UlJyktzks_yNbnEHVXBJTgqu-DA08K53WaJfK4Ms,139640
152
- lyrics_transcriber/output/generator.py,sha256=dpEIqdX0Dc0_kpfOoZMxGryVIopSRSgnV7EjVEB7YZw,10916
152
+ lyrics_transcriber/output/generator.py,sha256=jruQv0FQHlVkrLML-rcJqWCR7n5YT1QRE9yDBjqQJy0,11990
153
153
  lyrics_transcriber/output/lrc_to_cdg.py,sha256=2pi5tvreD_ADAR4RF5yVwj7OJ4Pf5Zo_EJ7rt4iH3k0,2063
154
154
  lyrics_transcriber/output/lyrics_file.py,sha256=_KQyQjCOMIwQdQ0115uEAUIjQWTRmShkSfQuINPKxaw,3741
155
155
  lyrics_transcriber/output/plain_text.py,sha256=XARaWcy6MeQeQCUoz0PV_bHoBw5dba-u79bjS7XucnE,3867
156
156
  lyrics_transcriber/output/segment_resizer.py,sha256=rrgcQC28eExSAmGnm6ytkF-E-nH4Fe3gjvpaCD0MCmA,17510
157
- lyrics_transcriber/output/subtitles.py,sha256=yQCR7YO3aitKnGRjfAtSwsdi6byfpEZgnCumJO16M2E,19085
157
+ lyrics_transcriber/output/subtitles.py,sha256=mOenx1sLlhVwkr3Y3Z-p2AMB_OZYeffguyjNAupEkvY,19114
158
158
  lyrics_transcriber/output/video.py,sha256=VLsoDTGb3aXuxg7o6Uv-JJV0A79C06o3LtzywOHwHcE,26268
159
159
  lyrics_transcriber/review/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
160
  lyrics_transcriber/review/server.py,sha256=WXWyJZJsKm6_HhGxRdP2fD7kyMAmuc_I-Kvqx_uA4NI,14833
@@ -165,8 +165,8 @@ lyrics_transcriber/transcribers/base_transcriber.py,sha256=T3m4ZCwZ9Bpv6Jvb2hNcn
165
165
  lyrics_transcriber/transcribers/whisper.py,sha256=YcCB1ic9H6zL1GS0jD0emu8-qlcH0QVEjjjYB4aLlIQ,13260
166
166
  lyrics_transcriber/types.py,sha256=wqFrTKhb8qAUB48zH-51_EEGCGrxm0Ji-ETfQumtSKc,27666
167
167
  lyrics_transcriber/utils/word_utils.py,sha256=-cMGpj9UV4F6IsoDKAV2i1aiqSO8eI91HMAm_igtVMk,958
168
- lyrics_transcriber-0.65.1.dist-info/LICENSE,sha256=81R_4XwMZDODHD7JcZeUR8IiCU8AD7Ajl6bmwR9tYDk,1074
169
- lyrics_transcriber-0.65.1.dist-info/METADATA,sha256=ykf3hhF376yTYqiZ8fTrIacpdSEHspWhLDcwMWH3zYM,6637
170
- lyrics_transcriber-0.65.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
171
- lyrics_transcriber-0.65.1.dist-info/entry_points.txt,sha256=kcp-bSFkCACAEA0t166Kek0HpaJUXRo5SlF5tVrqNBU,216
172
- lyrics_transcriber-0.65.1.dist-info/RECORD,,
168
+ lyrics_transcriber-0.68.0.dist-info/LICENSE,sha256=81R_4XwMZDODHD7JcZeUR8IiCU8AD7Ajl6bmwR9tYDk,1074
169
+ lyrics_transcriber-0.68.0.dist-info/METADATA,sha256=Jf3WPC0JIfvBEkdCo09fij9lUIWgl_NKzEqtgQy9sek,6637
170
+ lyrics_transcriber-0.68.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
171
+ lyrics_transcriber-0.68.0.dist-info/entry_points.txt,sha256=kcp-bSFkCACAEA0t166Kek0HpaJUXRo5SlF5tVrqNBU,216
172
+ lyrics_transcriber-0.68.0.dist-info/RECORD,,