Files
Cyrene_v2/cmd/cyrene/voice.go
T
AskaEth 52f08dc343
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled
docs(cyrene): cmd/cyrene 存量英文注释中文化(22 个非测试文件,仅注释)
- 四组并行完成:main/wire*.go、wire_capacity|channels|runtime、channels|persona_*|emotion|observability、
  voice|plugins|stream|skills|vision|subagent_tool|extractor|mcp|sessionread_tool|terminal_tool。
- 机械校验(git diff -U0 去 // 行与空行)仅剩 wire_frontend.go:84 一处行尾注释:代码前缀
  「\ta.gw = gw 」经 cat -A 与 HEAD 逐字节比对一致(allow 清单已声明)。
- 验收:隔离 worktree(HEAD + 本批 patch)go build/vet 绿、全树 58 包 ok、
  linux/amd64 + darwin/arm64 交叉编译绿;gofmt -l 干净。
- 备注:整树两次红均为负载敏感 flake(backthink / orchestration 的 timeout 类用例单独 -count=20 全过)。
2026-10-04 16:58:06 +08:00

18 lines
712 B
Go

package main
import (
"git.yeij.top/AskaEth/Cyrene_v2/internal/logger"
"git.yeij.top/AskaEth/Cyrene_v2/internal/runtime/multimodal/voice"
)
// wireVoice 从配置构建语音 STT/TTS 降级链并挂到 app 上,供 WebSocket 的
// voice_input/voice_output 路径使用。降级链依次为 云 → 本地 → edge-tts/espeak →
// 静默,因此端点或 API key 缺失绝不会阻塞启动(设计上接受静默兜底)。
func (a *app) wireVoice() {
a.voice = voice.New(a.cfg.Voice)
logger.WithSource(a.log, "cmd/cyrene").Info("voice chain ready",
"tts_provider", a.cfg.Voice.TTSProvider,
"stt_provider", a.cfg.Voice.STTProvider,
"dashscope_configured", a.cfg.Voice.DashscopeAPIKey != "")
}