AgentSkillsCN

pdf2audio-minimax

使用MiniMax MCP服务器的文本转音频工具,将PDF文件转换为MP3音频。在用户希望将PDF转换为音频/MP3、从PDF制作有声书,或对PDF文档进行文本转语音时使用。需要PDF文件路径;语音ID可选(根据内容自动选择)。

SKILL.md
--- frontmatter
name: pdf2audio-minimax
description: "Convert PDF files to MP3 audio using MiniMax MCP Server's text-to-audio tool. Use when user wants to convert a PDF to audio/MP3, create audiobook from PDF, or text-to-speech for PDF documents. Requires PDF file path; voice ID is optional (auto-selects based on content)."

PDF to Audio Converter (MiniMax)

Convert PDF documents to MP3 audio files using MiniMax text-to-audio.

Input Format

code
/pdf2audio-minimax <pdf_file_path> [voice_id]

Examples:

  • /pdf2audio-minimax /path/to/story.pdf (auto-select voice)
  • /pdf2audio-minimax /path/to/story.pdf Chinese (Mandarin)_Gentleman

Workflow

1. Parse Arguments

Extract from user input:

  • pdf_path: Full path to the PDF file (required)
  • voice_id: Voice identifier (optional)

2. Read PDF Content

code
Read: file_path = <pdf_path>

3. Extract Text & Metadata

Extract readable text, skipping page numbers and headers. Keep chapter titles, body text, dialogue.

Extract metadata for file naming:

  1. Story Name: Extract from the PDF's parent directory name (e.g., /path/我的世界/chapters/file.pdf我的世界)
  2. Chapter Number: Extract from filename pattern *-XX.pdf or content like 第X章 (e.g., 我的世界-03.pdf03)
  3. Chapter Title: Extract from the first chapter heading in content (e.g., 第3章:迷宫里的真心话迷宫里的真心话)

4. Select Voice

If voice_id provided: Use the specified voice.

If voice_id not provided: Auto-select based on content keywords:

Content KeywordsVoice ID
童话、儿童、小朋友、冒险Chinese (Mandarin)_Cute_Spirit
言情、爱情、浪漫、甜蜜Chinese (Mandarin)_Sweet_Lady
科幻、悬疑、历史、战争Chinese (Mandarin)_Gentleman
新闻、报告、公告Chinese (Mandarin)_News_Anchor
DefaultChinese (Mandarin)_Gentleman

For complete voice list, see references/voices.md.

5. Convert to Audio

code
mcp__MiniMax__text_to_audio:
  text: <extracted_text>
  voice_id: <selected_voice_id>
  output_directory: <audiobook subdirectory in story folder>
  language_boost: "Chinese"
  speed: 1

6. Rename Output File

After MiniMax generates the MP3, rename it to follow the naming convention:

code
<STORY_NAME>_<CHAPTER_NUMBER>_<CHAPTER_TITLE>.mp3

Examples:

  • 我的世界_03_迷宫里的真心话.mp3
  • 文明的最后一个变量_01_第一次接触.mp3

Rename command:

bash
mv "<generated_file>.mp3" "<output_directory>/<STORY_NAME>_<CHAPTER_NUMBER>_<CHAPTER_TITLE>.mp3"

7. Output

Report the final MP3 path with the properly formatted filename.

Quick Reference: Common Voices

Use CaseVoice ID
Audiobook (male)Chinese (Mandarin)_Gentleman
Audiobook (female)Chinese (Mandarin)_Soft_Girl
Children's storyChinese (Mandarin)_Cute_Spirit
News/FormalChinese (Mandarin)_News_Anchor

Full voice reference: references/voices.md