Skip to content
Automation
Skill

/txt2mp3

将文本内容转换为 MP3 语音文件,可选择直接朗读。当用户提到文字转语音、TTS、文本朗读、AI 配音时使用。

BOOST
From plugin
python-office
1.4k74 skills
Install
$ npx -y skills add coderwanfeng/python-office --skill txt2mp3 --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/txt2mp3

Context preview

The summary Claude sees to decide when to auto-load this skill.

将文本内容转换为 MP3 语音文件,可选择直接朗读。当用户提到文字转语音、TTS、文本朗读、AI 配音时使用。

SKILL.md

txt2mp3.SKILL.md
name: txt2mp3
description: 将文本内容转换为 MP3 语音文件,可选择直接朗读。当用户提到文字转语音、TTS、文本朗读、AI 配音时使用。

txt2mp3 Skill

> 文本转语音

功能描述

将文本内容转换为 mp3 语音文件,并可选择是否直接播放。

所属分类

`office/skills/video/txt2mp3/`

调用方式

from skills.video import txt2mp3

txt2mp3(
    content='你好,世界',
    file=None,
    mp3='./hello.mp3',
    speak=True
)

参数说明

| 参数 | 类型 | 必填 | 默认值 | 说明 | |------|------|------|--------|------| | `content` | str | 否 | `'程序员晚枫'` | 需要转换的内容 | | `file` | str | 否 | `None` | 指定读取的文件,优先级最高 | | `mp3` | str | 否 | `'./程序员晚枫.mp3'` | 需要保存的 mp3 位置和名称。填 `None` 不保存 | | `speak` | bool | 否 | `True` | 是否直接朗读 |

返回值

`None`

使用示例

from skills.video import txt2mp3
# 直接朗读
txt2mp3(content='你好,世界', mp3=None, speak=True)
# 保存为 mp3 文件
txt2mp3(content='你好,世界', mp3='./hello.mp3', speak=False)

原始函数

`office.api.video.txt2mp3`

Ships withpython-office

pip install python-office 自动化办公专用库

Get the whole plugin
Stats
1,358
Stars
303
Forks
Maintained
Maintenance
Python
Language
Apache-2.0
License
1mo ago
Last commit
4y ago
Created
1d ago
Added

Repo: coderwanfeng/python-office

Other skills on python-office.