feat(training+controls): interactive video pipeline, training blocks, control generator, CE libraries
Some checks failed
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Failing after 37s
CI/CD / test-python-backend-compliance (push) Successful in 39s
CI/CD / test-python-document-crawler (push) Successful in 26s
CI/CD / test-python-dsms-gateway (push) Successful in 23s
CI/CD / validate-canonical-controls (push) Successful in 12s
CI/CD / Deploy (push) Has been skipped
Some checks failed
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Failing after 37s
CI/CD / test-python-backend-compliance (push) Successful in 39s
CI/CD / test-python-document-crawler (push) Successful in 26s
CI/CD / test-python-dsms-gateway (push) Successful in 23s
CI/CD / validate-canonical-controls (push) Successful in 12s
CI/CD / Deploy (push) Has been skipped
Interactive Training Videos (CP-TRAIN): - DB migration 022: training_checkpoints + checkpoint_progress tables - NarratorScript generation via Anthropic (AI Teacher persona, German) - TTS batch synthesis + interactive video pipeline (slides + checkpoint slides + FFmpeg) - 4 new API endpoints: generate-interactive, interactive-manifest, checkpoint submit, checkpoint progress - InteractiveVideoPlayer component (HTML5 Video, quiz overlay, seek protection, progress tracking) - Learner portal integration with automatic completion on all checkpoints passed - 30 new tests (handler validation + grading logic + manifest/progress + seek protection) Training Blocks: - Block generator, block store, block config CRUD + preview/generate endpoints - Migration 021: training_blocks schema Control Generator + Canonical Library: - Control generator routes + service enhancements - Canonical control library helpers, sidebar entry - Citation backfill service + tests - CE libraries data (hazard, protection, evidence, lifecycle, components) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,7 +74,7 @@ class PiperTTS:
|
||||
if proc.returncode != 0:
|
||||
raise RuntimeError(f"Piper failed: {proc.stderr}")
|
||||
|
||||
def synthesize_to_mp3(self, text: str, output_dir: str) -> tuple[str, float]:
|
||||
def synthesize_to_mp3(self, text: str, output_dir: str, suffix: str = "") -> tuple[str, float]:
|
||||
"""
|
||||
Synthesize text to MP3.
|
||||
Splits text into sentences, synthesizes each, concatenates, encodes to MP3.
|
||||
@@ -88,16 +88,16 @@ class PiperTTS:
|
||||
wav_files = []
|
||||
try:
|
||||
for i, sentence in enumerate(sentences):
|
||||
wav_path = os.path.join(output_dir, f"seg_{i:04d}.wav")
|
||||
wav_path = os.path.join(output_dir, f"seg{suffix}_{i:04d}.wav")
|
||||
self.synthesize_to_wav(sentence, wav_path)
|
||||
wav_files.append(wav_path)
|
||||
|
||||
# Concatenate WAV files
|
||||
combined_wav = os.path.join(output_dir, "combined.wav")
|
||||
combined_wav = os.path.join(output_dir, f"combined{suffix}.wav")
|
||||
self._concatenate_wavs(wav_files, combined_wav)
|
||||
|
||||
# Convert to MP3
|
||||
mp3_path = os.path.join(output_dir, "output.mp3")
|
||||
mp3_path = os.path.join(output_dir, f"output{suffix}.mp3")
|
||||
self._wav_to_mp3(combined_wav, mp3_path)
|
||||
|
||||
# Get duration
|
||||
|
||||
Reference in New Issue
Block a user