Podcast Generation¶
Orchestrates the two-step pipeline: transcript generation via Gemini and audio synthesis via Vertex AI TTS.
Transcript prompt¶
The prompt instructs Gemini to write a dialogue between two hosts:
- Annabelle — the primary host
- Link — the co-host
Emotion tags and pacing cues are embedded inline in the text and interpreted by the TTS model:
Emotion tags: [determination], [enthusiasm], [awe], [curiosity], [excitement], [amusement], [frustration], [nervousness], and more.
Non-verbal: [laughs], [whispers]
Pacing: [slow], [fast], [short pause], [long pause]
Voice mapping¶
| Host | Vertex AI voice |
|---|---|
| Annabelle | Kore |
| Link | Puck |
Both voices use the gemini-3.1-flash-tts-preview model. Each turn is synthesized separately and the PCM frames are concatenated before writing the final WAV file.
Audio format¶
| Property | Value |
|---|---|
| Channels | 1 (mono) |
| Sample width | 2 bytes (16-bit PCM) |
| Frame rate | 24,000 Hz |
| Format | WAV |
Module reference¶
the_curator.podcast_generation
¶
logger = logging.getLogger(__name__)
module-attribute
¶
DEFAULT_PROJECT = 'the-curator-496412'
module-attribute
¶
PodcastGeneration
¶
Orchestrates transcript generation, TTS synthesis, and RSS feed publishing.
vertex_client = VertexClient(project=(os.environ.get('GOOGLE_CLOUD_PROJECT', DEFAULT_PROJECT)), location='us-central1')
instance-attribute
¶
bucket_name = bucket_name
instance-attribute
¶
storage_client = storage.Client(project=(os.environ.get('GOOGLE_CLOUD_PROJECT', DEFAULT_PROJECT)))
instance-attribute
¶
__init__(bucket_name: str) -> None
¶
Initialize Vertex AI and Cloud Storage clients for the given GCS bucket.
generate_transcript(topic: str) -> list[tuple[str, str]]
¶
Prompt Gemini for a two-host podcast transcript; return parsed (speaker, text) turns.
generate_podcast(transcript: list[tuple[str, str]]) -> str
¶
Synthesize transcript turns to a temp WAV file; return the file path.
publish_episode(title: str, sub_title: str, summary: str, author: str, description: str, audio_url: str, audio_length: int) -> None
¶
Load the RSS feed from GCS, append the episode item, and save it back.