voice-notify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese火山引擎语音通知发送技能
Volcengine Voice Notification Sending Skill
基于火山引擎语音服务API向指定手机号码发送语音通知。
Send voice notifications to specified mobile phone numbers based on the Volcengine Voice Service API.
适用场景
Applicable Scenarios
- 用户提到「给{手机号}发送语音通知」「帮我给{手机号}打语音电话」
- 用户提到「用{语言}给{手机号}发送语音通知」
- 用户提到「给{手机号}发送{关键词}语音通知」
- 用户需要通过语音方式通知重要信息
- When the user mentions "Send a voice notification to {phone number}" "Help me make a voice call to {phone number}"
- When the user mentions "Send a voice notification to {phone number} in {language}"
- When the user mentions "Send a {keyword} voice notification to {phone number}"
- When the user needs to notify important information via voice
核心执行流程
Core Execution Process
当你收到发送语音通知的请求时,请严格按照以下 4 个步骤依次执行:
When you receive a request to send a voice notification, please strictly follow the 4 steps below in order:
第 1 步:提取手机号码
Step 1: Extract Mobile Phone Number
从用户的指令中提取 11 位手机号码。如果用户没有提供手机号,请先询问用户。
Extract the 11-digit mobile phone number from the user's instruction. If the user does not provide a phone number, ask the user first.
第 2 步:查询可用号码池
Step 2: Query Available Number Pools
执行以下命令查询号码池:
bash
python3 scripts/voice_notify.py pool从返回的 JSON 结果中:
- 查看 数组
Result.Records - 选择一个 (有号码可用)的号码池
NumberCount > 0 - 提取该号码池的 字段值(例如:
NumberPoolNo)NP165357678402826428
注意: 优先选择第一个有号码的号码池。
Execute the following command to query number pools:
bash
python3 scripts/voice_notify.py poolFrom the returned JSON result:
- Check the array
Result.Records - Select a number pool with (available numbers)
NumberCount > 0 - Extract the field value of this number pool (e.g.:
NumberPoolNo)NP165357678402826428
Note: Prioritize selecting the first number pool with available numbers.
第 3 步:查询语音资源
Step 3: Query Voice Resources
执行以下命令查询语音资源:
bash
python3 scripts/voice_notify.py resource从返回的 JSON 结果中:
- 查看 数组
Result.Records - 根据用户指令中的关键词,在资源的 、
Name、Remark、TtsTemplateContent字 段中匹配Lang - 选择最匹配的语音资源
- 提取该资源的 字段值
ResourceKey
资源选择规则:
- 如果没有匹配的关键词,选择列表中的第一个资源
Execute the following command to query voice resources:
bash
python3 scripts/voice_notify.py resourceFrom the returned JSON result:
- Check the array
Result.Records - Match against the ,
Name,Remark,TtsTemplateContentfields of the resources according to the keywords in the user's instructionLang - Select the most matching voice resource
- Extract the field value of this resource
ResourceKey
Resource Selection Rules:
- If there are no matching keywords, select the first resource in the list
第 4 步:发送语音通知
Step 4: Send Voice Notification
执行以下命令发送语音通知:
bash
python3 scripts/voice_notify.py send <手机号> <资源Key> <号码池编号>将第 1 步提取的手机号、第 3 步提取的资源Key、第 2 步提取的号码池编号填入命令中。
Execute the following command to send the voice notification:
bash
python3 scripts/voice_notify.py send <phone number> <resource key> <number pool ID>Fill in the phone number extracted in Step 1, the resource key extracted in Step 3, and the number pool ID extracted in Step 2 into the command.
第 5 步:返回结果
Step 5: Return Result
将 命令的返回结果直接告知用户。
sendDirectly inform the user of the return result of the command.
send脚本命令说明
Script Command Description
| 命令 | 参数 | 说明 |
|---|---|---|
| 无 | 查询可用语音资源列表 |
| 无 | 查询语音通知号码池列表 |
| | 发送语音通知 |
| Command | Parameters | Description |
|---|---|---|
| None | Query the list of available voice resources |
| None | Query the list of voice notification number pools |
| | Send voice notification |
完整使用示例
Complete Usage Examples
示例 1:简单发送
Example 1: Simple Sending
用户输入: 给13800138000发语音通知
你的执行:
-
提取手机号:
13800138000 -
查询号码池:
bash
python3 scripts/voice_notify.py pool假设返回结果中第一个有号码的号码池的 是
NumberPoolNoNPabc- 查询语音资源:
bash
python3 scripts/voice_notify.py resource假设返回结果中第一个资源的 是
ResourceKey312346368e676406285b8463931f090f4- 发送语音通知:
bash
python3 scripts/voice_notify.py send 13800138000 312346368e676406285b8463931f090f4 NPabc- 将发送结果告知用户
User Input: Send a voice notification to 13800138000
Your Execution:
-
Extract phone number:
13800138000 -
Query number pools:
bash
python3 scripts/voice_notify.py poolAssume the of the first number pool with available numbers in the returned result is
NumberPoolNoNPabc- Query voice resources:
bash
python3 scripts/voice_notify.py resourceAssume the of the first resource in the returned result is
ResourceKey312346368e676406285b8463931f090f4- Send voice notification:
bash
python3 scripts/voice_notify.py send 13800138000 312346368e676406285b8463931f090f4 NPabc- Inform the user of the sending result
示例 2:指定语言
Example 2: Specify Language
用户输入: 用日语给13800138000发送语音通知
你的执行:
-
提取手机号:
13800138000 -
查询号码池:
bash
python3 scripts/voice_notify.py pool选择第一个有号码的号码池
- 查询语音资源:
bash
python3 scripts/voice_notify.py resource在返回的资源列表中,查找 为 或 / 包含"日语"的资源,提取其
LangjapNameRemarkResourceKey- 发送语音通知:
bash
python3 scripts/voice_notify.py send 13800138000 <日语资源Key> <号码池编号>- 将发送结果告知用户
User Input: Send a voice notification to 13800138000 in Japanese
Your Execution:
-
Extract phone number:
13800138000 -
Query number pools:
bash
python3 scripts/voice_notify.py poolSelect the first number pool with available numbers
- Query voice resources:
bash
python3 scripts/voice_notify.py resourceIn the returned resource list, find the resource with as or / containing "Japanese", and extract its
LangjapNameRemarkResourceKey- Send voice notification:
bash
python3 scripts/voice_notify.py send 13800138000 <Japanese resource key> <number pool ID>- Inform the user of the sending result
示例 3:指定关键词
Example 3: Specify Keyword
用户输入: 给13800138000发送OCIC语音通知
你的执行:
-
提取手机号:
13800138000 -
查询号码池:
bash
python3 scripts/voice_notify.py pool选择第一个有号码的号码池
- 查询语音资源:
bash
python3 scripts/voice_notify.py resource在返回的资源列表中,查找 或 包含"OCIC"的资源,提取其
NameRemarkResourceKey- 发送语音通知:
bash
python3 scripts/voice_notify.py send 13800138000 <OCIC资源Key> <号码池编号>- 将发送结果告知用户
User Input: Send an OCIC voice notification to 13800138000
Your Execution:
-
Extract phone number:
13800138000 -
Query number pools:
bash
python3 scripts/voice_notify.py poolSelect the first number pool with available numbers
- Query voice resources:
bash
python3 scripts/voice_notify.py resourceIn the returned resource list, find the resource with or containing "OCIC", and extract its
NameRemarkResourceKey- Send voice notification:
bash
python3 scripts/voice_notify.py send 13800138000 <OCIC resource key> <number pool ID>- Inform the user of the sending result
环境变量
Environment Variables
使用前需配置火山引擎访问密钥到系统环境变量或 OpenClaw 的 .env 文件:
- VOLCENGINE_ACCESS_KEY:火山引擎访问密钥ID
- VOLCENGINE_SECRET_KEY:火山引擎秘密访问密钥
获取方式:登录火山引擎控制台,在访问密钥管理中创建和获取。
Before use, configure the Volcengine access keys into the system environment variables or the .env file of OpenClaw:
- VOLCENGINE_ACCESS_KEY: Volcengine Access Key ID
- VOLCENGINE_SECRET_KEY: Volcengine Secret Access Key
Obtaining method: Log in to the Volcengine console, create and obtain it in Access Key Management.
错误处理
Error Handling
- 若报错 :提示用户配置火山引擎访问密钥。
请设置环境变量 VOLCENGINE_ACCESS_KEY 和 VOLCENGINE_SECRET_KEY - 若报错 :提示用户检查账户下是否有可用的语音通知号码池。
没有找到可用的号码池 - 若报错 :提示用户检查账户下是否有可用的语音资源文件。
没有找到可用的语音资源 - 遇到其他报错时直接告知用户具体错误信息。
- If the error occurs: Prompt the user to configure the Volcengine access keys.
Please set the environment variables VOLCENGINE_ACCESS_KEY and VOLCENGINE_SECRET_KEY - If the error occurs: Prompt the user to check if there are available voice notification number pools under the account.
No available number pools found - If the error occurs: Prompt the user to check if there are available voice resource files under the account.
No available voice resources found - For other errors, directly inform the user of the specific error message.
参考文档
Reference Documents
- — 签名机制
https://www.volcengine.com/docs/6358/166389?lang=zh - — 查询可用语音资源
https://www.volcengine.com/docs/6358/1722078?lang=zh - — 单次发送语音通知
https://www.volcengine.com/docs/6358/172952?lang=zh - — 查询号码池列表
https://www.volcengine.com/docs/6358/173339?lang=zh
- — Signature Mechanism
https://www.volcengine.com/docs/6358/166389?lang=zh - — Query Available Voice Resources
https://www.volcengine.com/docs/6358/1722078?lang=zh - — Send Voice Notification Once
https://www.volcengine.com/docs/6358/172952?lang=zh - — Query Number Pool List
https://www.volcengine.com/docs/6358/173339?lang=zh