bricks/dist/docs/zh/vadtext.md
yumoqing 2e22085122 feat: 401后登录成功自动重试原始请求
- withLoginInfo 改为接收完整 opts(含 method/headers/params)
- 等待 login_window 的 destroy 事件(=登录成功信号)
- 登录成功后重试原始请求
- 重试仍401则返回null(避免死循环)
- 用户手动关闭登录窗口时也触发重试,401则返回null
2026-05-27 15:39:34 +08:00

17 lines
968 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# VadText
控件功能:一个集成语音采集、音频播放和语音识别文本展示的复合控件,用户点击按钮开始录音,当检测到语音结束时自动将音频转为 WAV 格式并发送至后端进行语音识别,返回结果实时显示在文本区域中。
类型:容器控件
父类控件bricks.VBox
## 初始化参数
- `opts.name` *(可选)*: 控件名称,默认为 `'asr_text'`
- `opts.height`: 默认设置为 `'100%'`,占据父容器全部高度。
- 其他继承自 `VBox` 的通用布局参数(如 `width`, `align` 等)也可传入。
## 主要事件
- `audio_ready`: 当语音活动检测VAD捕获到一段完整的语音并生成音频数据时触发。携带参数为 `Float32Array` 类型的音频样本数据。
- `changed`: 当语音识别完成且有非空文本内容时,在停止录音后触发。携带当前控件的值对象 `{ [name]: text }`,可用于表单提交或状态同步。