Add show improvement features: crossfade, emotions, returning callers, transcripts, screening

- Music crossfade: smooth 3-second blend between tracks instead of hard stop/start
- Emotional detection: analyze host mood from recent messages so callers adapt tone
- AI caller summaries: generate call summaries with timestamps for show history
- Returning callers: persist regular callers across sessions with call history
- Session export: generate transcripts with speaker labels and chapter markers
- Caller screening: AI pre-screens phone callers to get name and topic while queued

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 02:43:01 -07:00
parent de5577e582
commit 356bf145b8
13 changed files with 3736 additions and 40 deletions

View File

@@ -344,6 +344,7 @@ def main():
parser.add_argument("--dry-run", "-d", action="store_true", help="Generate metadata but don't publish")
parser.add_argument("--title", "-t", help="Override generated title")
parser.add_argument("--description", help="Override generated description")
parser.add_argument("--session-data", "-s", help="Path to session export JSON (from /api/session/export)")
args = parser.parse_args()
audio_path = Path(args.audio_file).expanduser().resolve()
@@ -358,12 +359,28 @@ def main():
episode_number = get_next_episode_number()
print(f"Episode number: {episode_number}")
# Load session data if provided
session_data = None
if args.session_data:
session_path = Path(args.session_data).expanduser().resolve()
if session_path.exists():
with open(session_path) as f:
session_data = json.load(f)
print(f"Loaded session data: {session_data.get('call_count', 0)} calls")
else:
print(f"Warning: Session data file not found: {session_path}")
# Step 1: Transcribe
transcript = transcribe_audio(str(audio_path))
# Step 2: Generate metadata
metadata = generate_metadata(transcript, episode_number)
# Use session chapters if available (more accurate than LLM-generated)
if session_data and session_data.get("chapters"):
metadata["chapters"] = session_data["chapters"]
print(f" Using {len(metadata['chapters'])} chapters from session data")
# Apply overrides
if args.title:
metadata["title"] = args.title
@@ -374,6 +391,13 @@ def main():
chapters_path = audio_path.with_suffix(".chapters.json")
save_chapters(metadata, str(chapters_path))
# Save transcript alongside episode if session data available
if session_data and session_data.get("transcript"):
transcript_path = audio_path.with_suffix(".transcript.txt")
with open(transcript_path, "w") as f:
f.write(session_data["transcript"])
print(f" Transcript saved to: {transcript_path}")
if args.dry_run:
print("\n[DRY RUN] Would publish with:")
print(f" Title: {metadata['title']}")