openclaw - 💡(How to fix) Fix Feature: save TTS audio to disk during synthesis (talk/messages)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

{
  talk: {
    provider: "elevenlabs",
    providers: {
      elevenlabs: {
        voiceId: "...",
        saveAudioTo: "~/workspace/tts/",      // 新增:保存目录
      },
    },
  },
  messages: {
    tts: {
      provider: "elevenlabs",
      providers: {
        elevenlabs: {
          saveAudioTo: "~/workspace/tts/",     // messages.tts 同理
        },
      },
    },
  },
}
RAW_BUFFERClick to expand / collapse

Feature Request: TTS 音频同时落盘

提交到 https://github.com/openclaw/openclaw/issues/new

问题描述

Talk 模式使用 ElevenLabs 等云端 TTS provider 时,音频实时流式传输给客户端播放,但从不落盘。用户想本地存档语音对话记录时,只能通过额外 API 调用重新生成音频,TTS 费用翻倍。

实际上,SpeechSynthesisResult.audioBuffer 在网关内存中已经存在,只需加一个写文件步骤。

建议方案

在 TTS/talk provider 配置中新增 saveAudioTo 字段:

{
  talk: {
    provider: "elevenlabs",
    providers: {
      elevenlabs: {
        voiceId: "...",
        saveAudioTo: "~/workspace/tts/",      // 新增:保存目录
      },
    },
  },
  messages: {
    tts: {
      provider: "elevenlabs",
      providers: {
        elevenlabs: {
          saveAudioTo: "~/workspace/tts/",     // messages.tts 同理
        },
      },
    },
  },
}

备选方案(已排除)

方案问题
响应后手动调 API 再生成费用翻倍
BlackHole 截取系统音频截取所有音频,非仅 TTS
HTTP 代理拦截复杂且脆弱

实现难度

低。audioBuffer 已存在,只需加 fs.writeFile + 配置开关。

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Feature: save TTS audio to disk during synthesis (talk/messages)