Skip to content

chore: add Xunfei STT connectivity test script#16

Merged
ailuckly merged 1 commit into
developfrom
feat/realtime-voice-stt-p0-p1
Apr 15, 2026
Merged

chore: add Xunfei STT connectivity test script#16
ailuckly merged 1 commit into
developfrom
feat/realtime-voice-stt-p0-p1

Conversation

@ailuckly
Copy link
Copy Markdown
Owner

📌 变更内容

  • 如:新增用户登录 API
  • 如:修复登录失败时错误提示

✅ 测试验证

  • 本地运行通过
  • 自测通过
  • CI 流水线通过

PR 提交规范提醒:

  • 确保提交主题信息符合约定式提交规范 (feat/fix/docs/style/refactor/test/chore)
  • 确保代码已经通过本地测试
  • 确保没有提交敏感信息(密码、密钥等)

Copilot AI review requested due to automatic review settings April 15, 2026 17:06
@ailuckly ailuckly merged commit 71cc5e0 into develop Apr 15, 2026
7 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a standalone script under scripts/ to validate connectivity and basic functionality against Xunfei (科大讯飞) WebSocket STT (“iat”) by generating or loading PCM audio and streaming it frame-by-frame.

Changes:

  • Add scripts/test-xunfei-stt.py for building the authenticated WS URL, generating test PCM, and sending audio frames to Xunfei STT.
  • Print connection / recognition progress and summarize success/failure at the end.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +20
from datetime import datetime, timezone
from urllib.parse import urlencode
from email.utils import formatdate
import time
import struct
import math
import websocket
Comment on lines +2 to +4
"""
测试讯飞语音听写 WebSocket STT API
用法: python3 test-xunfei-stt.py <APP_ID> <API_KEY> <API_SECRET> [audio_file.pcm]
Comment on lines +111 to +113
url = build_url(app_id, api_key, api_secret)
print(f"[连接] {url[:80]}...")

if code != 0:
err = f"API错误 code={code}: {data.get('message', '')}"
print(f"[错误] {err}")
errors.append(err)
"""
测试讯飞语音听写 WebSocket STT API
用法: python3 test-xunfei-stt.py <APP_ID> <API_KEY> <API_SECRET> [audio_file.pcm]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants