Adding support for audio again
This commit is contained in:
+1
-1
@@ -2071,7 +2071,7 @@ def _print_render_plan_details(plan, marker_timings, slides: dict) -> None:
|
||||
print(f" {time_str} [{marker_id}]")
|
||||
elif marker_id.startswith("audio:"):
|
||||
aligned_count += 1
|
||||
print(f" {time_str} [audio:{marker_id[1:]}]")
|
||||
print(f" {time_str} [{marker_id}]")
|
||||
else:
|
||||
aligned_count += 1
|
||||
print(f' {marker_id:6} {time_str} "{context}"')
|
||||
|
||||
@@ -142,11 +142,15 @@ def _is_known_marker(
|
||||
if marker_id in CAMERA_PRESETS:
|
||||
return True
|
||||
|
||||
# Audio markers (A followed by id)
|
||||
# Audio markers (A followed by id, e.g., Awoosh) or audio: prefix (e.g., audio:woosh)
|
||||
if marker_id.startswith("A") and len(marker_id) > 1:
|
||||
audio_id = marker_id[1:]
|
||||
if audio_id in audio or audio_id.isdigit():
|
||||
return True
|
||||
if marker_id.startswith("audio:") and audio is not None:
|
||||
audio_id = marker_id[6:]
|
||||
if audio_id in audio:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
@@ -1014,9 +1018,12 @@ def _extract_audio_events(
|
||||
continue
|
||||
|
||||
marker_id = timing.marker_id
|
||||
audio_id = None
|
||||
if marker_id.startswith("A") and len(marker_id) > 1:
|
||||
audio_id = marker_id[1:]
|
||||
if audio_id in audio:
|
||||
elif marker_id.startswith("audio:"):
|
||||
audio_id = marker_id[6:]
|
||||
if audio_id is not None and audio_id in audio:
|
||||
if timing.timestamp < range_start or timing.timestamp >= range_end:
|
||||
continue
|
||||
start_time = max(0, timing.timestamp - AUDIO_OFFSET_SECONDS)
|
||||
|
||||
@@ -57,6 +57,9 @@ def validate_project(
|
||||
# Skip audio markers (start with 'A' followed by audio id, e.g., Awoosh)
|
||||
if marker.startswith("A") and len(marker) > 1 and marker[1:].isalnum():
|
||||
continue
|
||||
# Skip audio: prefix markers (e.g., audio:woosh)
|
||||
if marker.startswith("audio:"):
|
||||
continue
|
||||
# Validate video trigger markers — both legacy [video:xxx] and
|
||||
# shorthand [vft:xxx] / [vfb:xxx] / [vst:xxx] / [vsb:xxx].
|
||||
_VIDEO_PREFIXES = {
|
||||
|
||||
Reference in New Issue
Block a user