Send speech audio as normalized PCM frames

- Resample microphone input from the actual browser AudioContext sample rate to 16k before sending it to the speech proxy.

- Encode speech input as 16-bit PCM and send it in small 1280-byte frames instead of relying on the browser to create a 16k audio context.

- Flush pending audio before sending the standard Xunfei IAT end frame.

- Extract PCM helpers and cover downsampling, PCM encoding, base64 conversion, and byte concatenation with unit tests.

- Update report editor, testing, and progress documentation for the corrected speech audio pipeline.
This commit is contained in:
2026-05-02 06:30:56 +08:00
parent 87ab7d4b9c
commit 13d8853532
6 changed files with 128 additions and 26 deletions

View File

@@ -94,3 +94,4 @@
| 2026-05-02 | 修复报告编辑器加载已有 AI 区域后下拉栏初始显示“无可用 AI 区域”的问题。 |
| 2026-05-02 | 调整抽帧百分比为两位小数保序保存;自动截图按时间顺序执行,自动插入按配置顺序执行。 |
| 2026-05-02 | 加固报告编辑器语音采集,保留 Web Audio 节点引用、显式恢复 AudioContext并在无识别文本时给出提示。 |
| 2026-05-02 | 对齐讯飞 IAT 音频帧协议,前端按实际采样率重采样到 16k PCM、按小帧发送并使用标准结束帧。 |