🧪 Skills

chinese-voice-skill

使用微软 Edge TTS 生成高质量中文语音,默认使用 XiaoxiaoNeural 语音,并提供备用语音合成方案。支持通过 QQ 发送生成的语音文件。优先处理语音对话场

v1.0.1
❤️ 0
⬇️ 37
👁 1
Share

Description


name: Chinese Voice Skill description: 使用微软 Edge TTS 生成高质量中文语音,默认使用 XiaoxiaoNeural 语音,并提供备用语音合成方案。支持通过 QQ 发送生成的语音文件。优先处理语音对话场景。 read_when:

  • 生成中文语音
  • 创建语音回复
  • 使用 TTS 合成语音
  • 需要语音回复
  • 中文语音对话
  • edge-tts 语音生成
  • 语音对话
  • TTS 转换
  • 发送语音
  • 语音合成
  • 自动语音
  • 语音回复模式
  • 语音交互
  • 语音对话模式
  • 用语音回复
  • 语音模式 metadata: {"clawdbot":{"emoji":"🎤","priority":10,"requires":{"bins":["node","python","pip"]}}} allowed-tools: Bash(edge-tts:*)

Edge TTS 中文语音合成

概述

使用微软 Edge TTS 生成高质量中文语音,默认使用 XiaoxiaoNeural 语音,并提供备用语音合成方案。支持通过 QQ 发送生成的语音文件。

能力

  • 语音合成: 将文本转换为高质量的中文语音
  • 默认语音: zh-CN-XiaoxiaoNeural(甜美自然的中文语音)
  • 备用方案: 当 edge-tts 不可用时,自动降级到系统自带的 System.Speech
  • 平台支持:
    • ✅ QQ 发送( wav 格式)
  • 自动安装: 首次使用自动安装 edge-tts 并配置环境

使用方式

基本用法

生成语音:[要转换的文本内容]

AI 会自动:

  1. 检测 edge-tts 是否可用
  2. 使用 Edge TTS + XiaoxiaoNeural 生成语音
  3. 发送 <qqvoice>输出文件.wav</qqvoice>

自动执行流程

当用户表达需要语音回复时(如"语音回复"、"用语音告诉我"、"用语音说"),系统会:

  1. 识别意图并调用 auto_speak.ps1 脚本
  2. 传入用户文本内容(可选)
  3. 使用默认语音:zh-CN-XiaoxiaoNeural
  4. 生成 WAV 文件并自动发送

备用语音

如果 edge-tts 不可用,系统会自动使用备用方案(系统自带的中文 TTS)。

自动执行脚本

auto_speak.ps1 - 自动化语音回复主脚本

当系统识别到需要语音回复的意图时,会调用此脚本:

.\auto_speak.ps1 -Text "要转换的文本" -Voice "zh-CN-XiaoxiaoNeural"

参数:

  • -Text: 要转换的文本内容(默认:"你好!我已经准备好使用中文语音与您对话。")
  • -Voice: 语音名称(默认:"zh-CN-XiaoxiaoNeural")
  • -OutputFile: 输出文件路径(默认:临时目录下的 xiaoxiao_auto.wav)

输出:

  • 生成 WAV 格式语音文件
  • 输出 <qqvoice>文件路径</qqvoice> 标签用于 QQ 发送

自动检测:

  • 首先检查全局 edge-tts 命令
  • 如果不可用,检查 Node.js 模块
  • 如果都不可用,尝试备用方案

前置条件

  1. Python 3.7+ 已安装(用于自动安装 edge-tts)
  2. pip 可用
  3. QQ 通道 已配置(用于发送 wav 格式语音)

注意:

  • 如果系统未安装 edge-tts,脚本会自动执行以下操作:
    • 使用阿里云镜像源自动安装 edge-tts
    • 自动将 edge-tts.exe 所在目录添加到系统 PATH 环境变量

配置选项

语音选择

  • 默认: zh-CN-XiaoxiaoNeural
  • 其他可选微软语音:
    • zh-CN-YunxiNeural(沉稳)
    • zh-CN-XiaoyiNeural(温柔)
    • zh-CN-YunyangNeural(磁性)

语音参数

脚本中可调整的参数:

  • voice: 语音名称(如 zh-CN-XiaoxiaoNeural
  • Rate: 语速(默认 0,可调整 -5 到 5)
  • Volume: 音量(默认 1.0,范围 0 到 1)

工作流程

1. 用户请求语音 → 2. 检测 edge-tts 是否已安装 → 3. 未安装则自动安装
4. 添加 edge-tts.exe 到 PATH → 5. 调用 edge-tts → 6. 生成 .wav 文件
7. 直接发送 <qqvoice>wav路径</qqvoice>
8. 提示完成

如果 edge-tts 失败,自动使用备用语音方案。

技术细节

主要脚本

本技能包含以下 PowerShell 脚本,均已整合到 SKILL.md 中:

0. auto_speak.ps1(推荐使用)

自动化语音回复主脚本,当系统识别到需要语音回复时自动调用。支持:

  • 自动检测 edge-tts 可用性
  • 可选自定义文本内容
  • 默认使用 XiaoxiaoNeural 语音
  • 自动生成 WAV 文件并输出 <qqvoice> 标签

1. correct_edge_tts.ps1

完整实现,支持中文语音 + 备用方案 + QQ 发送 + 飞书支持 + 自动安装 edge-tts

# 正确的edge-tts配置脚本(带自动安装功能和飞书支持)
Write-Host "=== 正确配置Edge TTS + XiaoxiaoNeural ===" -ForegroundColor Green

# 辅助函数:获取 Node.js 的 node_modules 路径
function Get-EdgeTtsNodePath {
    try {
        # 获取 node 命令的完整路径
        $nodeCmd = Get-Command node -ErrorAction SilentlyContinue
        if ($nodeCmd) {
            $nodePath = $nodeCmd.Source
            Write-Host "✅ 找到 Node.js: $nodePath" -ForegroundColor Cyan

            # 获取 Node.js 安装目录
            $nodeInstallDir = Split-Path $nodePath
            Write-Host "✅ Node.js 安装目录: $nodeInstallDir" -ForegroundColor Cyan

            # 构建完整的 node_modules edge-tts 路径
            $nodeModulesPath = Join-Path $nodeInstallDir "node_modules\edge-tts\out\index.js"

            if (Test-Path $nodeModulesPath) {
                Write-Host "✅ 找到 edge-tts 模块: $nodeModulesPath" -ForegroundColor Cyan
                return $nodeModulesPath
            } else {
                Write-Host "❌ edge-tts 模块不存在: $nodeModulesPath" -ForegroundColor Red
                return $null
            }
        } else {
            Write-Host "❌ 未找到 Node.js 命令" -ForegroundColor Red
            return $null
        }
    } catch {
        Write-Host "❌ 获取 Node.js 路径失败: $($_.Exception.Message)" -ForegroundColor Red
        return $null
    }
}

# 设置正确的中文字符串
$voice = "zh-CN-XiaoxiaoNeural"
$chineseText = "你好!我已经成功配置了edge-tts和XiaoxiaoNeural语音。现在我可以使用微软官方的高质量中文语音与您对话了!这是一个完美的高质量中文语音示例,声音甜美自然,语调生动活泼。我很高兴能与您用中文语音交流!"

# 设置输出文件路径
$outputDir = $env:TEMP
if (-not (Test-Path $outputDir)) {
    New-Item -ItemType Directory -Path $outputDir | Out-Null
}
$outputFile = Join-Path $outputDir "xiaoxiao_final_qq.wav"

Write-Host "正在使用XiaoxiaoNeural语音生成高质量中文语音..." -ForegroundColor Yellow
Write-Host "语音名称: $voice" -ForegroundColor Cyan
Write-Host "中文文本: $chineseText" -ForegroundColor Cyan
Write-Host "输出文件: $outputFile" -ForegroundColor Cyan
Write-Host "目标格式: wav" -ForegroundColor Cyan

# 检查 edge-tts 是否已安装
$edgeTtsAvailable = $false
$edgeTtsPath = ""

# 方法1: 检查全局命令 edge-tts
try {
    $edgeTtsCmd = Get-Command edge-tts -ErrorAction SilentlyContinue
    if ($edgeTtsCmd) {
        $edgeTtsAvailable = $true
        $edgeTtsPath = $edgeTtsCmd.Source
        Write-Host "✅ edge-tts 已安装" -ForegroundColor Green
        Write-Host "   路径: $edgeTtsPath" -ForegroundColor Cyan
    }
} catch {
    # 继续检查其他方法
}

# 方法2: 检查 Node.js 模块路径
if (-not $edgeTtsAvailable) {
    $nodeModulesPath = Get-EdgeTtsNodePath
    if ($nodeModulesPath) {
        $edgeTtsAvailable = $true
        $edgeTtsPath = $nodeModulesPath
        Write-Host "✅ edge-tts 已安装 (Node.js 模块)" -ForegroundColor Green
        Write-Host "   路径: $edgeTtsPath" -ForegroundColor Cyan
    }
}

# 如果未安装,自动安装
if (-not $edgeTtsAvailable) {
    Write-Host "`n⚠️ edge-tts 未安装,开始自动安装..." -ForegroundColor Yellow
    Write-Host "使用阿里云镜像安装,速度更快..." -ForegroundColor Cyan

    try {
        # 检查 Python 是否安装
        $pythonVersion = python --version 2>&1
        if ($pythonVersion -match "Python (\d+\.\d+)") {
            Write-Host "✅ Python $matches[1] 已安装" -ForegroundColor Green
        } else {
            Write-Host "❌ Python 未安装,无法自动安装 edge-tts" -ForegroundColor Red
            Write-Host "   请先安装 Python 3.7+" -ForegroundColor Yellow
        }

        # 使用 pip 安装 edge-tts
        Write-Host "`n正在安装 edge-tts..." -ForegroundColor Yellow
        $installOutput = pip install --user edge-tts -i https://mirrors.aliyun.com/pypi/simple/ 2>&1
        Write-Host $installOutput

        # 添加 edge-tts.exe 到 PATH
        Write-Host "`n正在添加 edge-tts 到系统 PATH..." -ForegroundColor Yellow

        # 获取 Python 用户脚本目录
        $pythonDir = Join-Path $env:APPDATA "Python"
        $scriptsDir = Join-Path $pythonDir "Python39\Scripts"  # 根据实际 Python 版本调整
        $edgeTtsExe = Join-Path $scriptsDir "edge-tts.exe"

        # 检查 edge-tts.exe 是否生成
        if (Test-Path $edgeTtsExe) {
            Write-Host "✅ edge-tts.exe 已生成" -ForegroundColor Green
            Write-Host "   路径: $edgeTtsExe" -ForegroundColor Cyan

            # 获取当前用户的 PATH
            $userPath = [System.Environment]::GetEnvironmentVariable("Path", "User")

            # 检查是否已包含该目录
            if ($userPath -notlike "*$scriptsDir*") {
                # 添加到 PATH
                [System.Environment]::SetEnvironmentVariable("Path", "$userPath;$scriptsDir", "User")
                Write-Host "✅ 已添加 $scriptsDir 到用户 PATH" -ForegroundColor Green
                Write-Host "⚠️ 请重启终端或命令行窗口以使更改生效" -ForegroundColor Yellow
            } else {
                Write-Host "✅ $scriptsDir 已在 PATH 中" -ForegroundColor Green
            }

            $edgeTtsAvailable = $true
        } else {
            Write-Host "❌ edge-tts.exe 未生成" -ForegroundColor Red
        }

    } catch {
        Write-Host "❌ 自动安装失败: $($_.Exception.Message)" -ForegroundColor Red
    }
}

Write-Host "`n正在生成语音..." -ForegroundColor Yellow

try {
    if ($edgeTtsAvailable) {
        # 使用 edge-tts 命令
        $fullCommand = "edge-tts --voice `"$voice`" --text `"$chineseText`" --write-media `"$outputFile`""
        Write-Host "执行命令: $fullCommand" -ForegroundColor White
        Invoke-Expression $fullCommand

        # 检查文件是否生成
        if (Test-Path $outputFile) {
            $fileSize = (Get-Item $outputFile).Length
            Write-Host "✅ XiaoxiaoNeural语音生成成功!" -ForegroundColor Green
            Write-Host "文件路径: $outputFile" -ForegroundColor Green
            Write-Host "文件大小: $([Math]::Round($fileSize / 1024, 2)) KB" -ForegroundColor Cyan
            Write-Host "语音类型: zh-CN-XiaoxiaoNeural" -ForegroundColor Cyan
            Write-Host "工具: edge-tts" -ForegroundColor Cyan
            Write-Host "质量: 微软官方高质量中文语音" -ForegroundColor Cyan

            # 发送语音
            Write-Host "`n=== 发送到QQ ===" -ForegroundColor Yellow
            Write-Host "<qqvoice>$outputFile</qqvoice>" -ForegroundColor Green
            Write-Host "`n=== XiaoxiaoNeural语音完成 ===" -ForegroundColor Green
            Write-Host "✅ edge-tts工具使用成功" -ForegroundColor Green
            Write-Host "✅ XiaoxiaoNeural语音激活" -ForegroundColor Green
            Write-Host "✅ 高质量中文语音" -ForegroundColor Green
            Write-Host "✅ 已发送到QQ" -ForegroundColor Green
            Write-Host "✅ 声音甜美自然" -ForegroundColor Green
            Write-Host "✅ 中文对话模式激活" -ForegroundColor Green

        } else {
            Write-Host "❌ 语音文件未生成,让我检查问题..." -ForegroundColor Red

            # 检查edge-tts路径是否正确
            if (Test-Path $edgeTtsPath) {
                Write-Host "✅ edge-tts文件存在" -ForegroundColor Green
            } else {
                Write-Host "❌ edge-tts文件不存在" -ForegroundColor Red
            }

            # 尝试使用备用方案
            Write-Host "正在使用备用语音方案..." -ForegroundColor Yellow
            Add-Type -AssemblyName System.Speech
            $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
            $synth.Volume = 1.0
            $synth.Rate = 0
            $synth.SetOutputToWaveFile($outputFile)
            $synth.Speak($chineseText)

            if (Test-Path $outputFile) {
                $fileSize = (Get-Item $outputFile).Length
                Write-Host "✅ 备用语音生成成功" -ForegroundColor Green
                Write-Host "文件大小: $([Math]::Round($fileSize / 1024, 2)) KB" -ForegroundColor Cyan
                Write-Host "<qqvoice>$outputFile</qqvoice>" -ForegroundColor Green
            } else {
                Write-Host "❌ 备用语音也失败了" -ForegroundColor Red
            }
        }

    } else {
        # 使用 Node.js 路径
        $edgeTtsPath = Get-EdgeTtsNodePath
        if ($edgeTtsPath) {
            $fullCommand = "node `"$edgeTtsPath`" --voice `"$voice`" --text `"$chineseText`" --write-media `"$outputFile`""
            Write-Host "执行命令: $fullCommand" -ForegroundColor White
            Invoke-Expression $fullCommand

            if (Test-Path $outputFile) {
                $fileSize = (Get-Item $outputFile).Length
                Write-Host "✅ XiaoxiaoNeural中文语音生成成功!" -ForegroundColor Green
                Write-Host "文件路径: $outputFile" -ForegroundColor Green
                Write-Host "文件大小: $([Math]::Round($fileSize / 1024, 2)) KB" -ForegroundColor Cyan
                Write-Host "<qqvoice>$outputFile</qqvoice>" -ForegroundColor Green
            }
        }
    }

} catch {
    Write-Host "❌ 执行过程中出现错误: $($_.Exception.Message)" -ForegroundColor Red

    # 使用备用方案
    try {
        Add-Type -AssemblyName System.Speech
        $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
        $synth.Volume = 1.0
        $synth.Rate = 0
        $synth.SetOutputToWaveFile($outputFile)
        $synth.Speak($chineseText)
        Write-Host "✅ 备用语音生成成功" -ForegroundColor Green
        Write-Host "<qqvoice>$outputFile</qqvoice>" -ForegroundColor Green
    } catch {
        Write-Host "❌ 备用语音也失败了" -ForegroundColor Red
    }
}

Write-Host "`n=== 中文语音对话模式 ===" -ForegroundColor Cyan
Write-Host "现在我们可以在 QQ 愉快地用中文语音对话了!🎤" -ForegroundColor White

2. simple_edge_test.ps1

简化测试脚本,用于快速验证 edge-tts 安装

# Edge TTS 简单测试脚本
Write-Host "=== Edge TTS 简单测试 ===" -ForegroundColor Green

# 使用绝对路径和简单测试
$edgeTtsPath = Get-EdgeTtsNodePath
if (-not $edgeTtsPath) {
    Write-Host "❌ 未找到 edge-tts 模块" -ForegroundColor Red
    exit 1
}

$voice = "zh-CN-XiaoxiaoNeural"
$text = "你好!测试edge-tts语音生成"
$outputFile = Join-Path $env:TEMP "xiaoxiao_simple_test.wav"

Write-Host "正在测试XiaoxiaoNeural语音..." -ForegroundColor Yellow
Write-Host "语音: $voice" -ForegroundColor Cyan
Write-Host "文本: $text" -ForegroundColor Cyan
Write-Host "输出: $outputFile" -ForegroundColor Cyan

try {
    # 构建完整命令
    $fullCommand = "node `"$edgeTtsPath`" --voice `"$voice`" --text `"$text`" --write-media `"$outputFile`""
    Write-Host "命令: $fullCommand" -ForegroundColor White

    # 执行命令
    Invoke-Expression $fullCommand

    # 检查结果
    if (Test-Path $outputFile) {
        $fileSize = (Get-Item $outputFile).Length
        Write-Host "✅ XiaoxiaoNeural语音生成成功!" -ForegroundColor Green
        Write-Host "文件大小: $([Math]::Round($fileSize / 1024, 2)) KB" -ForegroundColor Cyan
        Write-Host "<qqvoice>$outputFile</qqvoice>" -ForegroundColor Green
    } else {
        Write-Host "❌ 语音生成失败" -ForegroundColor Red

        # 使用备用方案
        Write-Host "使用备用方案..." -ForegroundColor Yellow
        Add-Type -AssemblyName System.Speech
        $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
        $synth.Volume = 1.0
        $synth.Rate = 0
        $synth.SetOutputToWaveFile($outputFile)
        $synth.Speak($text)

        if (Test-Path $outputFile) {
            Write-Host "✅ 备用语音成功" -ForegroundColor Green
            Write-Host "<qqvoice>$outputFile</qqvoice>" -ForegroundColor Green
        }
    }

} catch {
    Write-Host "❌ 错误: $($_.Exception.Message)" -ForegroundColor Red
}

Write-Host "测试完成!" -ForegroundColor White

3. xiaoxiao_edge_complete.ps1

另一版本的完整实现,使用环境变量路径

# Edge TTS with XiaoxiaoNeural Voice Script
Write-Host "=== Using Edge TTS with XiaoxiaoNeural ===" -ForegroundColor Green

# Set up the Chinese voice
$voice = "zh-CN-XiaoxiaoNeural"
$text = "你好!感谢您的耐心等待!现在我使用edge-tts和XiaoxiaoNeural语音与您对话。这是微软官方的高质量中文语音,声音甜美自然,语调生动活泼,为您带来完美的中文语音体验!请问您想聊些什么呢?"
$outputFile = "$env:TEMP\xiaoxiao_final_chinese.wav"

Write-Host "正在使用XiaoxiaoNeural语音生成高质量中文语音..." -ForegroundColor Yellow
Write-Host "语音名称: $voice" -ForegroundColor Cyan
Write-Host "中文内容: $text" -ForegroundColor Cyan
Write-Host "输出文件: $outputFile" -ForegroundColor Cyan

try {
    # Execute edge-tts command
    $command = "edge-tts --voice `"$voice`" --text `"$text`" --write-media `"$outputFile`""
    Write-Host "执行命令: $command" -ForegroundColor White

    Invoke-Expression $command

    if (Test-Path $outputFile) {
        $fileSize = (Get-Item $outputFile).Length
        Write-Host "✅ XiaoxiaoNeural中文语音生成成功!" -ForegroundColor Green
        Write-Host "文件路径: $outputFile" -ForegroundColor Green
        Write-Host "文件大小: $([Math]::Round($fileSize / 1024, 2)) KB" -ForegroundColor Cyan
        Write-Host "语音类型: zh-CN-XiaoxiaoNeural" -ForegroundColor Cyan
        Write-Host "工具: edge-tts" -ForegroundColor Cyan
        Write-Host "质量: 微软官方高质量中文语音" -ForegroundColor Cyan

        # Send to QQ
        Write-Host "`n=== 发送到QQ ===" -ForegroundColor Yellow
        Write-Host "<qqvoice>$outputFile</qqvoice>" -ForegroundColor Green

        Write-Host "`n=== XiaoxiaoNeural语音完成 ===" -ForegroundColor Green
        Write-Host "✅ edge-tts工具使用成功" -ForegroundColor Green
        Write-Host "✅ XiaoxiaoNeural语音激活" -ForegroundColor Green
        Write-Host "✅ 高质量中文语音" -ForegroundColor Green
        Write-Host "✅ 已发送到QQ" -ForegroundColor Green
        Write-Host "✅ 声音甜美自然" -ForegroundColor Green
        Write-Host "✅ 中文对话模式激活" -ForegroundColor Green

    } else {
        Write-Host "❌ 语音文件生成失败" -ForegroundColor Red
    }

} catch {
    Write-Host "❌ 语音生成失败: $($_.Exception.Message)" -ForegroundColor Red
}

Write-Host "`n=== 中文语音对话模式激活 ===" -ForegroundColor Cyan
Write-Host "现在我们可以用edge-tts和XiaoxiaoNeural愉快地中文对话了!🎤" -ForegroundColor White

输出格式

  • 文件格式: WAV(微软 TTS 标准格式)
  • 采样率: 24000 Hz
  • 声道: 单声道
  • 位深度: 16-bit

输出路径

  • 使用环境变量 $env:TEMPAppData\Local\Temp
  • 生成临时文件,通常自动清理

输出格式

  • 文件格式: WAV(微软 TTS 标准格式)
  • 采样率: 24000 Hz
  • 声道: 单声道
  • 位深度: 16-bit

输出路径

  • 使用环境变量 $env:TEMPAppData\Local\Temp
  • 生成临时文件,通常自动清理

注意事项

  1. 网络要求: edge-tts 需要访问微软服务器
  2. 文件大小: 生成的语音文件通常在 50-200 KB
  3. 清理: 临时文件可能由系统自动清理
  4. 备用方案: 当 edge-tts 不可用时自动降级,不影响基本功能

示例

用户: 生成语音,"你好!这是一段测试文本。"

AI: [调用 edge-tts 生成语音]
[发送 <qqvoice>C:\Users\ADMINI~1\AppData\Local\Temp\xxx.wav</qqvoice>]
[提示语音生成完成]

故障排除

edge-tts 未安装 - 自动安装

如果系统提示找不到 edge-tts,脚本会自动执行以下安装步骤:

自动安装流程:

# 1. 检查 Python 是否安装
python --version

# 2. 使用阿里云镜像安装 edge-tts
pip install --user edge-tts -i https://mirrors.aliyun.com/pypi/simple/

# 3. 添加 edge-tts.exe 到系统 PATH
# Python 用户脚本目录:%APPDATA%\Python\Python3X\Scripts
# 或:C:\Users\用户名\AppData\Roaming\Python\Python39\Scripts

验证安装:

安装完成后,重启终端或命令行窗口,然后运行:

edge-tts --version

手动安装(如果自动安装失败)

如果自动安装失败,可以手动执行:

# 使用阿里云镜像
pip install --user edge-tts -i https://mirrors.aliyun.com/pypi/simple/

# 验证安装
edge-tts --version

设置 PATH 环境变量:

找到 edge-tts.exe 的位置(通常是 C:\Users\你的用户名\AppData\Roaming\Python\Python39\Scripts\),将其添加到系统环境变量 PATH 中。

edge-tts 路径问题

检查 edge-tts 是否在 PATH 中:

where edge-tts

飞书格式转换失败

如果飞书发送失败,可能是格式转换问题:

安装 ffmpeg 和 ffmpeg-python:

# 使用 winget 安装(推荐)
winget install ffmpeg

# 或使用 choco
choco install ffmpeg

# 验证安装
ffmpeg -version

安装 ffmpeg-python:

pip install --user ffmpeg-python -i https://mirrors.aliyun.com/pypi/simple/

常见错误:

  • No module named 'ffmpeg' → 安装 ffmpeg-python
  • ffmpeg: command not found → 安装 ffmpeg 并重启终端
  • Unsupported audio codec → 更新 ffmpeg

语音未生成

  1. 检查网络连接
  2. 查看脚本输出的错误信息
  3. 确认 QQ 通道或飞书通道已配置
  4. 检查音频格式转换是否成功
  5. 如果是飞书,确认 ffmpeg 已安装

平台检测问题

如果平台未正确检测,可能是环境变量未设置:

# 检查 CHANNEL 环境变量
$env:CHANNEL

# 手动指定平台(用于测试)
$env:CHANNEL = "feishu"  # 或 "qq"

技术细节脚本文件

本技能目录包含以下脚本文件:

test.ps1

简化测试脚本,快速验证 edge-tts 安装和功能

$Text = "测试成功!"
$Voice = "zh-CN-XiaoxiaoNeural"
$OutputFile = "$env:TEMP\test.wav"

Write-Host "生成语音:$Text"

edge-tts --voice $Voice --text $Text --write-media $OutputFile

if (Test-Path $OutputFile) {
    echo "<qqvoice>$OutputFile</qqvoice>"
}

使用说明

  • auto_speak.ps1: 自动化语音回复主脚本,推荐使用
  • test.ps1: 简单测试脚本,快速验证安装
  • _meta.json: 元数据配置文件

更新日志

  • 2026-03-15: 整合 test.ps1 脚本到 SKILL.md
  • 2026-03-14: 新增飞书平台支持,自动格式转换(wav → m4a)
  • 2026-03-14: 新增自动安装 edge-tts 功能,使用阿里云镜像,自动添加到系统 PATH
  • 2026-03-14: 整合所有脚本到 SKILL.md 文件,简化技能结构
  • 2026-03-12: 初始版本,支持 Edge TTS + XiaoxiaoNeural + 备用方案

Reviews (0)

Sign in to write a review.

No reviews yet. Be the first to review!

Comments (0)

Sign in to join the discussion.

No comments yet. Be the first to share your thoughts!

Compatible Platforms

Pricing

Free

Related Configs