← 返回
未分类 中文

Voice Input Patch – Dual Mic Buttons

Patch OpenClaw Control UI to add dual voice input buttons (auto-send + continuous). Use when OpenClaw voice input needs patching, after OpenClaw updates (pat...
在OpenClaw控制界面打补丁,添加双语音输入按钮(自动发送+连续)。适用于OpenClaw语音输入需要补丁时,或OpenClaw更新后(...
elzershark elzershark 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 369
下载
💾 0
安装
1
版本
#latest

概述

OpenClaw Voice Input Patch

Adds smart voice input to the Control UI chat — same one mic button, but with hold-to-activate.

What This Does

Before: One mic button. Speak → text appears → must press Enter manually.

After: Same one mic button — but smarter, with hold-to-activate:

  • Short click → Auto-send: mic activates, speak, on pause text is sent automatically, mic turns off. If you say nothing for ~3 seconds, the mic auto-stops (browser SpeechRecognition timeout) — acts as a natural "misclick" safeguard.
  • Hold 3 seconds → Continuous mode: mic stays on after each message. After every speech pause, text is sent and recognition restarts. Click again to stop.
  • Live interim transcript shown above the input field while either mode is active.
  • Tooltip adapts: "Voice (hold 3s for continuous)" when idle, "Stop voice auto" or "Stop voice continuous" when recording.

Note: If the browser shows "microphone denied" errors, the microphone=(self) Permissions-Policy fix is also needed. This was merged into OpenClaw on April 18, 2026 — if you're on version 2026.4.18+, it's already included. On older versions, see the Troubleshooting section.

Step 1: Find the file

There is exactly one file to patch. It's always at:

.../openclaw/dist/control-ui/assets/index-<hash>.js

The hash in the filename changes with every OpenClaw version. Find it with:

Linux / Mac:

find / -path "*/openclaw/dist/control-ui/assets/index-*.js" 2>/dev/null | head -1

Windows (PowerShell):

Get-ChildItem -Path C:\ -Recurse -Filter "index-*.js" -ErrorAction SilentlyContinue | Where-Object { $_.FullName -match "openclaw\\dist\\control-ui\\assets" } | Select-Object -First 1 -ExpandProperty FullName

Quick alternative: Run npm root -g to find the global node_modules path, then look inside for openclaw/dist/control-ui/assets/index-*.js.

If you (the AI agent) cannot find or access the file, tell the user:

> "I couldn't access the OpenClaw Control UI file. Can you help? Either:

> 1. Copy the file into my workspace so I can patch it, then copy it back after. Run this in your terminal:

> cp /path/to/openclaw/dist/control-ui/assets/index-*.js ~/.openclaw/workspace-allgemein/

> 2. Or give me write access:

> sudo chown -R $(whoami) /path/to/openclaw/dist/"

Keep it simple. Don't over-explain.

Step 2: Back up

cp <path-to-index-file> <path-to-index-file>.bak

Step 3: Verify compatibility

Before patching, confirm these patterns exist in the file. If any are missing, the OpenClaw version has changed — do NOT proceed. Instead, inspect the file and adapt, or wait for an updated version of this skill.

PatternWhat it is
------
function NC(e)Speech recognition start function
sttRecordingRecording state variable
N.micOffMic-off icon reference
jC()Speech recognition availability check

Step 4: Add sttRecordingCont state variable

Find this exact text:

sttRecording:!1,sttInterimText

Replace with:

sttRecording:!1,sttRecordingCont:!1,sttInterimText

This appears exactly once in the file.

Verify: Search for sttRecordingCont:!1 — must appear exactly once.

Step 5: Show interim text for both recording states

Find this exact text:

${X.sttRecording&&X.sttInterimText?i`<div class="agent-chat__stt-interim">${X.sttInterimText}</div>`:h}

Replace with:

${(X.sttRecording||X.sttRecordingCont)&&X.sttInterimText?i`<div class="agent-chat__stt-interim">${X.sttInterimText}</div>`:h}

This appears exactly once in the file.

Verify: Search for (X.sttRecording||X.sttRecordingCont) — must appear in the line containing stt-interim.

Step 6: Replace single mic button with hold-for-continuous button

This is the most complex patch. Replace the ENTIRE mic button block with a single button that supports both short-click (auto-send) and hold-3s (continuous) modes.

6.1 Find the block

Search for the text Stop recording or Voice input in the file. This is inside the mic button template.

The block to replace starts at ${jC()?i and ends at :h} — both on the same line as Stop recording/Voice input, or on the lines immediately surrounding it.

It contains exactly ONE

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 06:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 196 📥 67,842
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,766
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 680 📥 328,628