#!/usr/bin/env python3 """ Complete Intro Cutscene Voice Generation Generates all dialogue for the intro sequence """ import asyncio import edge_tts from pathlib import Path OUTPUT_DIR = Path("/Users/davidkotnik/repos/novafarma/assets/audio/voiceover/intro") # Voice configurations NARRATOR_VOICE = "en-US-GuyNeural" # Deep, mysterious KAI_VOICE = "en-US-AvaNeural" # Young female async def generate_intro_voices(): """Generate all intro cutscene dialogue""" # Create output directory OUTPUT_DIR.mkdir(parents=True, exist_ok=True) print("๐ŸŽฌ GENERATING INTRO CUTSCENE VOICES...") print("="*60) # ======================================== # PART 1: THE FLYOVER (Narrator) # ======================================== print("\n๐Ÿ“ Part 1: The Flyover (Narrator)") narrator_flyover = ( "They say the world didn't die with a bang... " "but with a quiet whisper. " "The Valley of Death is not just a place. " "It's a memory that no one wants to have anymore." ) await generate_voice( text=narrator_flyover, voice=NARRATOR_VOICE, output_path=OUTPUT_DIR / "01_narrator_flyover.mp3", rate="-10%", # Slower, dramatic pitch="-5Hz" # Deeper ) # ======================================== # PART 2: THE AWAKENING (Kai) # ======================================== print("\n๐Ÿ“ Part 2: The Awakening (Kai)") kai_awakening = ( "My head... it hurts. Where am I? Who am I...?" ) await generate_voice( text=kai_awakening, voice=KAI_VOICE, output_path=OUTPUT_DIR / "02_kai_awakening.mp3", rate="-15%", # Slower, confused pitch="-3Hz" # Slightly lower ) # ======================================== # PART 3: THE TRUTH (Kai - multiple lines) # ======================================== print("\n๐Ÿ“ Part 3: The Truth (Kai)") # Line 1: Reading ID card kai_truth_1 = ( "Kai Markoviฤ‡. 14 years old. That's me. " "But this other girl... why do I feel so... empty when I see her? " "Like I'm missing half of my heart." ) await generate_voice( text=kai_truth_1, voice=KAI_VOICE, output_path=OUTPUT_DIR / "03_kai_truth_part1.mp3", rate="-5%", # Normal pace, emotional pitch="+0Hz" ) # Line 2: Final determination kai_truth_2 = ( "Someone is waiting for me out there. " "I can't remember the face, but I feel the promise. " "I'm coming to find you... Ana." ) await generate_voice( text=kai_truth_2, voice=KAI_VOICE, output_path=OUTPUT_DIR / "04_kai_truth_part2.mp3", rate="+0%", # Normal pace, determined pitch="+2Hz" # Slightly higher, hopeful ) print("\n" + "="*60) print("โœ… ALL INTRO VOICES GENERATED!") print("="*60) print(f"\nOutput directory: {OUTPUT_DIR}") print("\nGenerated files:") print(" 1. 01_narrator_flyover.mp3 (Narrator - The Flyover)") print(" 2. 02_kai_awakening.mp3 (Kai - Awakening)") print(" 3. 03_kai_truth_part1.mp3 (Kai - Reading ID)") print(" 4. 04_kai_truth_part2.mp3 (Kai - Determination)") async def generate_voice(text, voice, output_path, rate="+0%", pitch="+0Hz"): """Generate single voice line""" print(f"\n๐ŸŽ™๏ธ Generating: {output_path.name}") print(f" Voice: {voice}") print(f" Text: {text[:60]}...") communicate = edge_tts.Communicate(text, voice, rate=rate, pitch=pitch) await communicate.save(str(output_path)) size = output_path.stat().st_size print(f" โœ… Saved: {size:,} bytes") if __name__ == "__main__": asyncio.run(generate_intro_voices())