Bước 9 — Probe thời lượng thực tế của master audio và các part audio trên worker Mục tiêu: - Đo chính xác thời lượng thực của audio/master_narration.wav sau khi đã compose ở bước 8. - Nếu đã tạo part audio, đo luôn thời lượng thực của từng file part. - Khóa bộ mốc thời gian thật để dùng cho các bước sau, tuyệt đối không dựa vào thời lượng ước tính. Vì sao bắt buộc: - Sau khi ghép TTS scene ở bước 8, thời lượng thực tế có thể lệch do khoảng lặng, resample, chuẩn hóa audio hoặc xử lý compose. - Nếu không probe mà dùng số ước tính, ASR, subtitle mapping, chia part và render sync-safe rất dễ lệch nhịp. - Mọi mốc sync phía sau phải bám vào file audio thật đã được đo kiểm. Worker endpoint: - http://192.168.1.104:8002/probe Input: - audio/master_narration.wav - audio/master_narration_timeline.json hoặc timeline/segments do bước 8 tạo ra - các file part_XX.wav nếu đã có Cách làm: 1. Gọi worker probe endpoint. 2. Probe audio/master_narration.wav để lấy duration thực, sample rate, channel count, codec/format. 3. Nếu đã có part audio, probe từng part_XX.wav để lấy duration thực. 4. So sánh duration dự kiến từ timeline bước 8 với duration thực từ probe. 5. Nếu có lệch, ghi nhận mức lệch và giữ duration thực làm source of truth cho downstream steps. Probe request shape: { "input_path": "/data/video-pipeline/Youtube-Video-Maker/Project//audio/master_narration.wav" } Output bắt buộc: - audio/master_audio_probe.json - logs/step9_probe_audio_manifest.json Output JSON tối thiểu: { "master_audio_path": ".../audio/master_narration.wav", "master_duration_sec": 697.52, "parts": [ { "part_id": "part_01", "audio_path": ".../part_01.wav", "duration_sec": 123.45 } ], "notes": ["Use probe duration as source of truth."] } Quy tắc quan trọng: - Không dùng duration cộng tay từ các scene TTS để thay cho probe. - Không bỏ qua bước này chỉ vì audio nghe có vẻ đúng. - Từ bước 10 trở đi, timing phải bám vào duration thực đã probe. Bước này phục vụ trực tiếp: - Bước 10: ASR trên master audio - Bước 11: map subtitle theo text gốc + timing ASR - Bước 13: chia part sync-safe - Bước 14-15: render part và concat đúng sync Checklist: 9. Probe and lock the real duration of audio/master_narration.wav and any part_XX.wav files on worker 192.168.1.104:8002/probe; downstream timing must use these probed values, not estimates.