git clone https://github.com/AgriciDaniel/claude-blog.git--- name: blog-audio description: > Generate audio narration of blog posts using Google Gemini TTS. Supports summary narration, full article read-aloud, and two-speaker podcast/dialogue mode with 30 voice options. Outputs MP3 with HTML5 audio embed code. Works standalone via /blog audio or internally from blog-write. Falls back gracefully when API key is not configured. Use when user says "blog audio", "narrate blog", "audio version", "text to speech", "tts", "podcast mode", "read aloud", "audio narration", "voice", "narration", "generate audio". user-invokable: true argument-hint: "[generate|voices|setup] [file-or-text] [--mode summary|full|dialogue] [--voice name]" license: MIT metadata: author: AgriciDaniel version: "1.9.1" --- # Blog Audio: Gemini TTS Narration for Blog Posts Generate professional audio narration of blog content using Google's Gemini TTS. Three modes: summary (200-300 word spoken overview), full article read-aloud, or two-speaker podcast dialogue. 30 voices, 80+ languages, HTML5 embed output. ## Quick Reference | Command | What it does | |---------|-------------| | `/blog audio generate <file>` | Generate audio narration of a blog post | | `/blog audio voices` | Show available voices with characteristics | | `/blog audio setup` | Check/configure API key for Gemini TTS | ## Prerequisites - Python 3.11+ (venv managed automatically by `run.py`) - `GOOGLE_AI_API_KEY` environment variable (same key used by blog-image) - FFmpeg (for WAV-to-MP3 conversion; falls back to WAV if missing) ## Always Use run.py Wrapper ```bash # CORRECT: python3 scripts/run.py generate_audio.py --text "..." --voice Charon --json # WRONG: python3 scripts/generate_audio.py --text "..." # Fails without venv ``` ## API Key Check (Gate Pattern) Before generating audio, check for the API key: ```bash echo $GOOGLE_AI_API_KEY ``` - If set: proceed with generation - If not set: guide the user: "Audio generation requires a Google AI API key. Get one free at https://aistudio.google.com/apikey Then set it: `export GOOGLE_AI_API_KEY=your-key` This is the same key used by `/blog image`: if image generation works, audio works too." - **When called internally** (from blog-write): return silently if key is missing. Never block the writing workflow. ## Setup For `/blog audio setup`: 1. Check if `GOOGLE_AI_API_KEY` is set in environment 2. If blog-image is configured (check `.mcp.json`), the key is already available 3. If not, guide user to https://aistudio.google.com/apikey 4. Verify with a dry run: `python3 scripts/run.py generate_audio.py --text "Test" --dry-run --json` ## Voice Selection For `/blog audio voices`: Load `references/voices.md` and present the voice catalog to the user. Ask the user which voice they prefer, or recommend based on content type: - **Article narration**: Charon (Informative) or Sadaltager (Knowledgeable) - **Tutorial/how-to**: Achird (Friendly) or Sulafat (Warm) - **News/analysis**: Rasalgethi (Informative) or Schedar (Even) - **Lifestyle/wellness**: Aoede (Breezy) or Vindemiatrix (Gentle) - **Dialogue host**: Puck (Upbeat) or Laomedeia (Upbeat) - **Dialogue expert**: Kore (Firm) or Charon (Informative) ## Generation Workflow For `/blog audio generate <file>`: ### Step 1: Read the Blog Post Read the file and extract: - Title (from H1 or frontmatter) - Full content (markdown body) - Approximate word count ### Step 2: Choose Mode Ask the user (or auto-select if they specified `--mode`): | Mode | When to use | Output | |------|-------------|--------| | **Summary** | Quick audio overview (1-2 min) | 200-300 word spoken summary | | **Full** | Complete read-aloud (5-15 min) | Full article as natural speech | | **Dialogue** | Podcast-style (3-8 min) | Two-person conversation about the article | ### Step 3: Prepare Text **CRITICAL:** Claude prepares the text. The script does TTS only. **Summary mode:** Write a 200-300 word spoken summary of the article. Rules: - Write as natural speech, not written text - Open with the article's key finding or answer - Cover 3-5 main takeaways - Close with actionable advice - No markdown, no "In this article...", no meta-commentary - Use conversational transitions ("Here's what matters...", "The key finding is...") **Full mode:** Strip the markdown content to clean spoken text: - Headings become natural transitions ("Next, let's look at...") - Links become plain text (remove URLs, keep anchor text) - Images and charts: omit or briefly describe ("As the data shows...") - Code blocks: describe verbally ("The code uses a for-loop to...") - Lists: convert to natural sentences - Remove frontmatter, schema markup, HTML tags - Add brief intro: "This is [title], published on [date]." **Dialogue mode:** Write a 2-person conversation script about the article: - Speaker1 = Host (curious, asks good questions) - Speaker2 = Expert (knowledgeable, gives clear answers) - Format each line as: `[Speaker1] What's the key takeaway here?` - Cover the article's main points conversationally - 15-25 exchanges (produces ~3-8 minutes) - Natural, not stilted ("That's a great point" over "Indeed, as the research indicates") ### Step 4: Select Voice If the user chose a voice, use it. Otherwise, recommend based on mode: - Summary/Full: default to Charon (Informative) - Dialogue: default to Puck (Host) + Kore (Expert) ### Step 5: Generate Audio Write the prepared text to a temp file, then call: ```bash # Single voice (summary or full mode) python3 scripts/run.py generate_audio.py \ --text-file /tmp/blog_audio_prepared.txt \ --voice Charon \ --model flash \ --output /path/to/audio/post-slug.mp3 \ --json # Two voices (dialogue mode) python3 scripts/run.py generate_audio.py \ --text-file /tmp/blog_audio_dialogue.txt \ --voice Puck \ --voice2 Kore \ --model pro \ --output /path/to/audio/post-slug-dialogue.mp3 \ --json ``` **Model selection:** - `flash` (default): Fast, cheap. Good for summaries and standard narration. - `pro`: Higher quality. Use for dialogue mode or premium content. ### Step 6: Deliver Present the result to the user: 1. **File path**: where the audio was saved 2. **Duration**: human-readable (e.g., "3:42") 3. **Embed code**: ready-to-paste HTML5 audio tag 4. **Cost**: estimated API cost 5. **Placement suggestion**: where to insert the embed in the blog post ## Embedding Guide ### Standard HTML (Hugo, Jekyll, static sites) ```html <audio controls preload="metadata"> <source src="audio/post-slug.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ``` ### MDX (Next.js, Gatsby) ```jsx <audio controls preload="metadata"> <source src="/audio/post-slug.mp3" type="audio/mpeg" /> </audio> ``` ### WordPress ``` [audio src="audio/post-slug.mp3"] ``` ### Placement Insert the audio player after the introduction (below the first H2) or at the very top of the article with a label: "Listen to this article" or "Audio version". ## Internal API (for blog-write) When invoked internally from blog-write: **Input:** - `text`: Prepared text (already cleaned by Claude) - `voice`: Voice name (default: Charon) - `voice2`: Second voice for dialogue (optional) - `model`: flash or pro - `output_path`: Where to save the file **Output:** ```markdown ### Audio Narration - **Path:** /path/to/audio/post-slug.mp3 - **Duration:** 3:42 - **Voice:** Charon - **Embed:** `<audio controls preload="metadata"><source src="audio/post-slug.mp3" type="audio/mpeg"></audio>` ``` **Graceful fallback:** If `GOOGLE_AI_API_KEY` is not set, return immediately with no error. The writing workflow continues without audio. Never block blog-write because audio generation is unavailable. ## Error Handling | Error | Resolution | |-------|-----------| | GOOGLE_AI_API_KEY not set | Get key at https://aistudio.google.com/apikey | | FFmpeg not found | Install: `sudo apt install ffmpeg`. Falls back to WAV output. | | Rate limited | Wait and retry. Check limits at https://aistudio.google.com/rate-limit | | Text too long (>32k tokens) | Split into sections, generate separately | | Unknown voice name | Run `/blog audio voices` to see valid options | | API error | Check key validity, model availability (preview models) | | API key missing (internal call) | Return silently: writing workflow continues | ## Reference Documentation Load on-demand: do NOT load all at startup: - `references/voices.md`: Full 30-voice catalog, recommendations by content type, dialogue pairings
["Prepare your blog post: Ensure the text is polished and ready for narration. Remove any formatting issues or placeholders that might confuse the AI.","Customize the prompt: Replace [BLOG_POST_TITLE], [MUSIC_OR_SOUND_EFFECTS], [DURATION_MINUTES], and [PLATFORM] with your specific requirements. For example, '[MUSIC_OR_SOUND_EFFECTS]: soft piano background' or '[DURATION_MINUTES]: 15'.","Generate the audio: Use an AI tool like ElevenLabs, Descript, or Murf.ai to convert the text into speech. Some tools allow you to adjust the voice tone (e.g., professional, conversational, or energetic).","Edit and refine: Listen to the generated audio and make adjustments. Add pauses, emphasize key points, or trim sections to fit the desired duration. Use editing software like Audacity or Adobe Audition if needed.","Export and distribute: Save the final audio as an MP3 file with chapter markers. Upload it to your desired platform (e.g., Spotify, YouTube, or your company’s website) and share it with your audience."]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/AgriciDaniel/claude-blog/tree/main/skills/blog-audioCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Convert the blog post '[BLOG_POST_TITLE]' into a high-quality audio narration. Use a natural, engaging tone suitable for a podcast or audiobook. Include [MUSIC_OR_SOUND_EFFECTS] if requested. Ensure the narration is [DURATION_MINUTES] long and optimized for listening on [PLATFORM, e.g., Spotify, YouTube, or a corporate website]. Format the output as an MP3 file with clear chapter markers for sections like 'Introduction,' 'Key Takeaways,' and 'Conclusion.'
Here’s the audio narration for the blog post titled '10 Strategies to Boost Remote Team Productivity in 2024.' The narration is 12 minutes and 45 seconds long, optimized for Spotify, and includes subtle background music to enhance engagement. **Introduction (0:00 - 1:30):** 'Welcome to today’s deep dive on remote team productivity. In this episode, we’ll explore 10 actionable strategies that leaders can implement right away to transform their distributed teams into high-performing units. Whether you’re managing a startup or a Fortune 500 company, these insights will help you bridge the gap between remote work and peak performance. Let’s get started.' **Section 1: Clear Communication Channels (1:30 - 4:15):** 'First up, establish clear communication channels. Tools like Slack and Microsoft Teams are great, but they’re only as effective as the guidelines you set. For example, at TechGuru Inc., they implemented a 'no-meeting Wednesday' policy, which reduced unnecessary interruptions by 30%. The key? Define when synchronous vs. asynchronous communication should be used. For urgent matters, use voice or video calls. For updates, rely on threaded messages in Slack. This simple rule cut their response times in half.' **Key Takeaways (9:30 - 11:00):** 'To summarize, focus on three pillars: communication, trust, and flexibility. Start by auditing your current tools and processes. Ask your team for feedback on what’s working and what’s not. Then, implement one or two changes at a time—don’t overwhelm your team with too many adjustments at once. Finally, measure the impact. Use metrics like response times, project completion rates, and employee satisfaction scores to track progress.' **Conclusion (11:00 - 12:45):** 'Remote work isn’t going away, and neither are the challenges that come with it. But with the right strategies, you can turn those challenges into opportunities. Start small, stay consistent, and always prioritize your team’s well-being. For more insights, check out the full blog post linked in the description. Thanks for listening, and here’s to your team’s success in 2024!'
skills-collection
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan