Skip to content

Doubao-powered voice input for Linux, Wayland and Omarchy

fix(asr): stream official recognition results live

quanru837e35a6f1b9
diff --git a/README.md b/README.md
index 6280832..cf74d74 100644
--- a/README.md
+++ b/README.md
@@ -42,9 +42,10 @@ Open **Doubao Say** from your application launcher:
Open **Settings → Recognition service**, select **Volcengine official API**, and
enter the API key issued by the Volcengine Speech Recognition console. Changes
save automatically. Use **Test API key** before the voice test. This backend uses
-the Seed ASR 2.0 single-direction streaming endpoint and the hourly resource
-`volc.seedasr.sauc.duration`; PCM audio is uploaded while you speak and the final
-result is returned after recording stops. Volcengine bills usage to your account.
+the Seed ASR 2.0 bidirectional streaming endpoint and the hourly resource
+`volc.seedasr.sauc.duration`; PCM audio is uploaded while you speak, incremental
+text is returned live, and the final result arrives after recording stops.
+Volcengine bills usage to your account.
The API key is stored in `~/.config/doubao-say/volcengine_api_key` (or the
equivalent `XDG_CONFIG_HOME` path) with owner-only permissions. It is never added
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 897b5b6..1b806ef 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -33,8 +33,8 @@ System 读取桌面会话的语言偏好,中文区域使用简体中文,其
打开**设置 → 语音识别服务**,选择**火山引擎官方 API**,填写火山引擎语音识别控制台
签发的 API Key。修改会自动保存,建议先点击**测试 API Key**,再进行试说。该后端使用
-Seed ASR 2.0 单向流式接口和小时版资源 `volc.seedasr.sauc.duration`:说话时上传 PCM
-音频,录音结束后返回最终结果;用量由火山引擎向你的账号计费。
+Seed ASR 2.0 双向流式接口和小时版资源 `volc.seedasr.sauc.duration`:说话时上传 PCM
+音频并实时返回增量识别文字,录音结束后返回最终结果;用量由火山引擎向你的账号计费。
API Key 保存在 `~/.config/doubao-say/volcengine_api_key`(或对应的
`XDG_CONFIG_HOME` 路径),权限仅限当前用户读取;不会进入设置文件、诊断信息、日志、
diff --git a/src/doubao_input/doubao/volcengine_asr_client.py b/src/doubao_input/doubao/volcengine_asr_client.py
index 6d588c1..116e951 100644
--- a/src/doubao_input/doubao/volcengine_asr_client.py
+++ b/src/doubao_input/doubao/volcengine_asr_client.py
@@ -17,7 +17,7 @@ from doubao_input.doubao.volcengine_protocol import (
logger = logging.getLogger(__name__)
-VOLCENGINE_ASR_URL = "wss://openspeech.bytedance.com/api/v3/sauc/bigmodel_nostream"
+VOLCENGINE_ASR_URL = "wss://openspeech.bytedance.com/api/v3/sauc/bigmodel"
MAX_PENDING_BYTES = 1024 * 1024
diff --git a/tests/test_volcengine_asr_client.py b/tests/test_volcengine_asr_client.py
index c3cf9e0..4e0418a 100644
--- a/tests/test_volcengine_asr_client.py
+++ b/tests/test_volcengine_asr_client.py
@@ -8,7 +8,9 @@ import threading
import unittest
from unittest.mock import Mock
-from doubao_input.doubao.volcengine_asr_client import VolcengineASRClient
+from doubao_input.doubao.volcengine_asr_client import (
+ VOLCENGINE_ASR_URL, VolcengineASRClient,
+)
from doubao_input.doubao.volcengine_credentials import VolcengineCredentials
@@ -63,6 +65,12 @@ class VolcengineASRClientTest(unittest.TestCase):
self.addCleanup(client.disconnect)
return client
+ def test_uses_bidirectional_streaming_endpoint(self):
+ self.assertEqual(
+ VOLCENGINE_ASR_URL,
+ "wss://openspeech.bytedance.com/api/v3/sauc/bigmodel",
+ )
+
def stop(self, client, session):
client.disconnect()
session.thread.join(3)