SuperAPI AI Directory

podcast generate

Writing & research

View repository

Updated 10-15 23:33

About this skill

Podcast Generate Skill (TypeScript version)

Automatically generate podcast scripts and audio based on user-provided materials or web search results.

This Skill is suitable for:

  • Quick comprehension and podcastization of long-form content
  • Audio presentation of knowledge-based content
  • In-depth interpretation and discussion of trending topics
  • Searching real-time information and podcast production

Capability Description

What this Skill can do

  • Generate from file: Receive a piece of material (txt/md/docx/pdf and other text formats), generate a dialogue podcast script and audio
  • Generate via web search: Based on a topic specified by the user, search the web for the latest information, and generate a podcast script and audio
  • Automatically control duration, automatically adjusted according to content length (3-20 minutes)
  • Generate a podcast script in Markdown format (can be manually edited)
  • Use z-ai TTS to synthesize high-quality audio and concatenate it into the final podcast

What this Skill currently does not do

  • Does not generate mp3 / subtitles / timestamps
  • Does not support podcast roles of three or more people
  • Does not add background music or sound effects

Files and Responsibilities Description

This Skill consists of the following files:

  • generate.ts Unified entry point (supports file mode and search mode)

    • File mode: Read the text file uploaded by the user → generate podcast
    • Search mode: Call the web-search skill to obtain materials → generate podcast
    • Use z-ai-web-dev-sdk for LLM script generation
    • Use z-ai-web-dev-sdk for TTS audio generation
    • Automatically concatenate audio segments
    • Only output the final file
  • readme.md Usage documentation

  • SKILL.md The current file, describing the Skill's capabilities, boundaries, and usage conventions

  • package.json Node.js project configuration and dependencies

  • tsconfig.json TypeScript compilation configuration


Input and Output Conventions

Input (choose one of two)

Method 1: File upload

  • One material file (txt / md / docx / pdf and other text formats)
  • Material length is unlimited; the Skill will automatically compress it to an appropriate length

Method 2: Web search

  • The user specifies a search topic
  • Automatically call the web-search skill to obtain related content
  • Integrate multiple search results as material sources

Output (only 2 files are output)

  • podcast_script.md Podcast script (Markdown format, can be manually edited)

  • podcast.wav The final concatenated podcast audio

No intermediate files are output(such as segments.jsonl, meta.json, etc.)


How to Run

Dependency Environment

  • Node.js 18+
  • z-ai-web-dev-sdk (already installed)
  • web-search skill (used for web search mode)

Not required z-ai CLI

Install Dependencies

npm install

Usage Examples

Generate podcast from file

npm run generate -- --input=test_data/material.txt --out_dir=out

Generate podcast via web search

# 根据主题搜索并生成播客
npm run generate -- --topic="最新AI技术突破" --out_dir=out

# 指定搜索主题和时长
npm run generate -- --topic="量子计算应用场景" --out_dir=out --duration=8

# 搜索并生成单人播客
npm run generate -- --topic="气候变化影响" --out_dir=out --mode=single-male

Parameter Description

Parameter Description Default Value
--input Input material file path (choose one of two with --topic) -
--topic Search topic keyword (choose one of two with --input) -
--out_dir Output directory (required) -
--mode Podcast mode: dual / single-male / single-female dual
--duration Manually specify minutes (3-20); 0 means automatic 0
--host_name Host/Anchor name Xiaopu
--guest_name Guest name Chuichui
--voice_host Host voice xiaochen
--voice_guest Guest voice chuichui
--speed Speech rate (0.5-2.0) 1.0
--pause_ms Pause between segments in milliseconds 200

Available voices

Voice Characteristics
xiaochen Calm and professional
chuichui Lively and cute
tongtong Warm and friendly
jam British gentleman
kazi Clear and standard
douji Natural and fluent
luodo Highly expressive

Technical architecture

generate.ts (unified entry point)

  • File mode: read user-uploaded file → generate podcast
  • Search mode: call web-search skill → obtain materials → generate podcast
  • LLM: use z-ai-web-dev-sdk (chat.completions.create)
  • TTS: use z-ai-web-dev-sdk (audio.tts.create)
  • Not required z-ai CLI
  • Automatically concatenate audio segments
  • Only output the final file; intermediate files are automatically cleaned up

LLM calls

  • System prompt: podcast script writer role
  • User prompt: includes materials + hard constraints + breathing-feel requirements
  • Output validation: word count, structure, role tags
  • Automatic retry: up to 3 times

TTS calls

  • Use zai.audio.tts.create()
  • Supports custom voices and speech rates
  • Automatically concatenate multiple wav segments
  • Temporary files are automatically cleaned up

Output example

podcast_script.md (excerpt)

**小谱**:大家好,欢迎收听今天的播客。今天我们来聊一个有趣的话题……

**锤锤**:是啊,这个话题真的很有意思。我最近也在关注……

**小谱**:说到这里,我想给大家举个例子……

License

MIT