fix(voice): 改用火山「新版控制台」API Key 鉴权(ASR 握手真机验通)

一直误用旧版 5 头方案(X-Api-App-Key+Access-Key+App-ID),火山始终 401 grant not found。
用户提供官方文档「新版本控制台」证实:新版只需**单个 X-Api-Key** 头。改对后真机联调:

- frame.go setVolcAuthHeaders: X-Api-Key + X-Api-Resource-Id + X-Api-Request-Id + X-Api-Sequence:-1
  (删旧 App-Key/Access-Key/App-ID/Connect-Id;去 appID 参数)
- asr/tts 调用点同步;config.go 删 Config.AppID;voicecheck/voiceconfig 删 VOLC_APP_ID
- 删临时诊断工具 voiceprobe

真机结果:ASR 握手(volc.bigasr.sauc.duration 有效);TTS 用 seed-tts-2.0 会话正常建立
(不再 resource mismatch),但暂无音频返回→双向 TTS 事件/payload 待调(下一步)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-22 10:42:36 +08:00
parent c5397438d4
commit d6c1a787f4
6 changed files with 16 additions and 26 deletions
+1 -2
View File
@@ -8,8 +8,7 @@ import "github.com/sundynix/sundynix-shared/secrets"
// AuthorizationBearer <APIKey>+ X-Api-Resource-Id(区分服务,ASR 与双向 TTS 各一个)。
// 端点/音频格式(PCM 16k 单声道等)由代码固定,不入用户配置。
type Config struct {
APIKey string `json:"api_key"` // 新版 API KeyX-Api-Access-Key,密文入库)
AppID string `json:"app_id"` // 火山 App IDX-Api-App-ID,解析账号资源授权用;V3 流式端点需要)
APIKey string `json:"api_key"` // 新版控制台 API KeyX-Api-Key,密文入库)
ASRResourceID string `json:"asr_resource_id"` // 流式语音识别 X-Api-Resource-Id
TTSResourceID string `json:"tts_resource_id"` // 双向流式 TTS X-Api-Resource-Id
TTSVoiceType string `json:"tts_voice_type"` // 音色(如 zh_male_… / BV700_streaming