bricks/dist/docs/en/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

1.2 KiB

VadText

Control Functionality: A composite control that integrates voice capture, audio playback, and speech recognition text display. The user clicks a button to start recording. When speech termination is detected, the audio is automatically converted into WAV format and sent to the backend for speech recognition. The recognition result is then displayed in real time within the text area.
Type: Container Control
Parent Control: bricks.VBox

Initialization Parameters

  • opts.name (Optional): Name of the control; defaults to 'asr_text'.
  • opts.height: Defaults to '100%', occupying the full height of the parent container.
  • Other common layout parameters inherited from VBox (such as width, align, etc.) can also be passed in.

Main Events

  • audio_ready: Triggered when voice activity detection (VAD) captures a complete utterance and generates audio data. The event carries Float32Array type audio sample data.
  • changed: Triggered after recording stops, when speech recognition is completed and returns non-empty text content. Carries the current control's value object { [name]: text }, which can be used for form submission or state synchronization.