Labsco
microsoft logo

podcast-generation

✓ Official2,700

by microsoft · part of microsoft/skills

Generate AI-powered podcast-style audio narratives using Azure OpenAI's GPT Realtime Mini model via WebSocket. Use when building text-to-speech features, audio…

🔥🔥🔥✓ VerifiedFreeQuick setup
🧩 One of 7 skills in the microsoft/skills package — works on its own, and pairs well with its siblings.

Generate AI-powered podcast-style audio narratives using Azure OpenAI's GPT Realtime Mini model via WebSocket. Use when building text-to-speech features, audio…

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by microsoft

Generate AI-powered podcast-style audio narratives using Azure OpenAI's GPT Realtime Mini model via WebSocket. Use when building text-to-speech features, audio… npx skills add https://github.com/microsoft/agent-skills --skill podcast-generation Download ZIPGitHub2.7k

Podcast Generation with GPT Realtime Mini

Generate real audio narratives from text content using Azure OpenAI's Realtime API.

Core Workflow

Backend Audio Generation

Copy & paste — that's it
from openai import AsyncOpenAI
import base64

# Convert HTTPS endpoint to WebSocket URL
ws_url = endpoint.replace("https://", "wss://") + "/openai/v1"

client = AsyncOpenAI(
 websocket_base_url=ws_url,
 api_key=api_key
)

audio_chunks = []
transcript_parts = []

async with client.realtime.connect(model="gpt-realtime-mini") as conn:
 # Configure for audio-only output
 await conn.session.update(session={
 "output_modalities": ["audio"],
 "instructions": "You are a narrator. Speak naturally."
 })
 
 # Send text to narrate
 await conn.conversation.item.create(item={
 "type": "message",
 "role": "user",
 "content": [{"type": "input_text", "text": prompt}]
 })
 
 await conn.response.create()
 
 # Collect streaming events
 async for event in conn:
 if event.type == "response.output_audio.delta":
 audio_chunks.append(base64.b64decode(event.delta))
 elif event.type == "response.output_audio_transcript.delta":
 transcript_parts.append(event.delta)
 elif event.type == "response.done":
 break

# Convert PCM to WAV (see scripts/pcm_to_wav.py)
pcm_audio = b''.join(audio_chunks)
wav_audio = pcm_to_wav(pcm_audio, sample_rate=24000)

Frontend Audio Playback

Copy & paste — that's it
// Convert base64 WAV to playable blob
const base64ToBlob = (base64, mimeType) => {
 const bytes = atob(base64);
 const arr = new Uint8Array(bytes.length);
 for (let i = 0; i Voice Character 
 alloy Neutral 
 echo Warm 
 fable Expressive 
 onyx Deep 
 nova Friendly 
 shimmer Clear

## Realtime API Events

- `response.output_audio.delta` - Base64 audio chunk 

- `response.output_audio_transcript.delta` - Transcript text 

- `response.done` - Generation complete 

- `error` - Handle with `event.error.message`

## Audio Format

- **Input**: Text prompt 

- **Output**: PCM audio (24kHz, 16-bit, mono) 

- **Storage**: Base64-encoded WAV

## References

- **Full architecture**: See [references/architecture.md](https://github.com/microsoft/agent-skills/blob/main/.github/skills/podcast-generation/references/architecture.md) for complete stack design 

- **Code examples**: See [references/code-examples.md](https://github.com/microsoft/agent-skills/blob/main/.github/skills/podcast-generation/references/code-examples.md) for production patterns 

- **PCM conversion**: Use [scripts/pcm_to_wav.py](https://github.com/microsoft/agent-skills/blob/main/.github/skills/podcast-generation/scripts/pcm_to_wav.py) for audio format conversion