RealtimeSTT 测试体系全指南:从快速单元测试到 Golden 转录与 FastAPI 多用户负载验证

发布时间:2026/9/15 16:20:08
RealtimeSTT 测试体系全指南:从快速单元测试到 Golden 转录与 FastAPI 多用户负载验证 RealtimeSTT 测试体系全指南从快速单元测试到 Golden 转录与 FastAPI 多用户负载验证【免费下载链接】RealtimeSTTA robust, efficient, low-latency speech-to-text library with advanced voice activity detection, wake word activation and instant transcription.项目地址: https://gitcode.com/GitHub_Trending/re/RealtimeSTTRealtimeSTT 是一套集成了 VAD 语音活动检测、唤醒词与实时转写能力的语音转文本库其测试体系围绕「快速、可离线、可复用」与「真实模型、真实音频、真实延迟」两个层次设计。本文将基于 docs/testing.md 展开带你完整掌握 RealtimeSTT 的两类测试——不下载模型的快速单元/契约测试以及需要真实语音模型的 opt-in Golden 转录测试——并深入讲解 FastAPI 多用户负载测试的指标含义、Windows 环境注意事项以及为新增转录引擎编写测试的最佳实践。一、测试体系总览两条分层的主线RealtimeSTT 的测试在设计上刻意分成两类避免“跑一次测试要下载几个 GB 模型”成为常态快速单元测试与契约测试Fast Unit and Contract Tests运行时不下载任何语音模型完全依赖 mock 对象与假后端fake runtime / fake backend验证工厂选择、参数映射、音频校验、结果转换等契约行为。这是 CI 与日常开发的主力。Opt-in Golden 转录测试Golden Transcription Tests下载或加载真实语音模型把小段音频 fixture 转写后与期望文本比对。因为更慢、首次运行可能需要联网、部分平台还需要额外权限默认被跳过只有显式设置环境变量后才运行。音频 fixture 统一存放在 tests/unit/audio素材基于公有领域Public Domain的 LJ Speech 样本。而tests/目录下直接放置的手动演示脚本、回归压测脚本与历史实验则在 docs/test-scripts.md 中单独说明——两者不要混淆。从源码结构看tests/unit 下每个转录引擎都对应一个独立测试文件test_whisper_cpp_engine.py、test_sherpa_onnx_engine.py、test_kroko_onnx_engine.py、test_omnilingual_asr_engine.py等这为“新增引擎必须伴随契约测试”提供了制度性保障。二、音频 FixtureLJ Speech 样本与 Manifest 校验Golden 测试依赖确定性的音频输入。tests/unit/audio/中的样本基于 LJ Speech 1.1 数据集公有领域每个样本包含一个 16-bit PCM、单声道 WAV 文件如LJ001-0002.wav一个对应的期望文本文件如LJ001-0002.txt一份汇总的 manifest.json声明了数据集、采样率、通道数、位深及每个样本的transcript与normalized_transcript。以 manifest.json 为例其核心字段包括datasetLJ Speech 1.1、licensePublic Domain、sample_rate_hz22050、channels1、sample_width_bits16以及 5 条样本记录例如{ id: LJ001-0002, file: LJ001-0002.wav, transcript_file: LJ001-0002.txt, transcript: in being comparatively modern., normalized_transcript: in being comparatively modern. }test_audio_fixtures.py 中的AudioFixtureTests.test_manifest_points_to_valid_wav_and_transcript_files会对 fixture 本身做契约校验manifest 必须指向真实存在的 WAV 与 transcript 文件、文本内容必须一致、WAV 必须是单声道 16-bit PCM 且采样率与 manifest 声明一致、帧数必须大于 0。同文件中的FeedAudioTests则验证了录音器核心的feed_audio行为不足一个 buffer 的原始 PCM 字节会被暂存凑满2 * buffer_size字节后才放入音频队列以original_sample_rate喂入非 16 kHz 音频时会按16000 / sample_rate的比例重采样并正确分块例如把 22050 Hz 的 LJ Speech 样本重采样到 16 kHz。这两组测试是理解后续 Golden 测试如何“喂音频”的基础Golden 测试正是用 1024 样本一批的方式把 WAV 逐步feed_audio给录音器实例再取出recorder.text()与期望文本比对。三、快速单元测试不下载模型的默认测试集从仓库根目录运行默认快速测试集PowerShellpython -m unittest -v tests.unit.test_audio_fixtures tests.unit.test_whisper_cpp_engine tests.unit.test_openai_whisper_engine tests.unit.test_additional_transcription_engines tests.unit.test_cohere_transcribe_engine tests.unit.test_granite_speech_engine tests.unit.test_moonshine_engine tests.unit.test_sherpa_onnx_engine tests.unit.test_kroko_onnx_engine tests.unit.test_omnilingual_asr_engine tests.unit.test_realtime_streaming_transcription tests.unit.test_fastapi_server_protocol tests.unit.test_fastapi_server_multi_user请使用当前激活虚拟环境中的 Python 解释器而非全局 Python。运行要点没有设置 Golden 环境变量时慢速模型测试会被有意跳过。结果中出现skipped意味着快速测试全部通过而 opt-in 的模型测试没有运行——这是预期行为不是失败。各引擎测试文件内部对真实后端的调用做了 mock。例如 test_whisper_cpp_engine.py 中WhisperCppFactoryTests通过 patchPyWhisperCppBackend为FakeBackend来验证工厂创建行为WhisperCppEngineContractTests则验证了音频归一化如[0.0, 2.0, -1.0]归一化为[0.0, 0.95, -0.475]、beam_search/greedy 解码策略切换、initial_prompt与 token 提示词的传递、空音频报错等契约。类似地test_kroko_onnx_engine.py 使用FakeKrokoRecognizer、FakeKrokoStream等假对象不安装也不导入 Kroko-ONNX 运行时即可跑通test_omnilingual_asr_engine.py 使用假 Omnilingual 运行时对象同样不安装不导入 Meta 的 Omnilingual ASR 包。四、Golden 转录测试真实模型驱动的端到端验证Golden 测试是 RealtimeSTT 质量闭环的核心加载真实模型 → 转写 fixture 音频 → 与期望文本比对。它们默认关闭需要先安装可选依赖、再显式设置环境变量。所有环境变量在 PowerShell 中设置test-model-cache/目录被 Git 忽略可以放心存放下载的本地测试模型。4.1 faster-whisper Golden 测试$env:REALTIMESTT_RUN_GOLDEN_TRANSCRIPTION 1 $env:REALTIMESTT_TEST_MODEL tiny $env:REALTIMESTT_TEST_DEVICE cpu $env:REALTIMESTT_TEST_COMPUTE_TYPE int8 python -m unittest -v tests.unit.test_audio_fixtures.GoldenTranscriptionTests对应 test_audio_fixtures.py 中的GoldenTranscriptionTests它以use_microphoneFalse创建AudioToTextRecorder把 manifest 中第一个样本按 1024 样本分批feed_audio等待录音器收集到帧后取text()断言转写文本非空且前两个词与期望文本匹配。环境变量直接映射到录音器参数REALTIMESTT_TEST_MODEL→model默认tiny、REALTIMESTT_TEST_DEVICE→device默认cpu、REALTIMESTT_TEST_COMPUTE_TYPE→compute_type默认int8。4.2 whisper.cpp Golden 测试python -m pip install RealtimeSTT[whisper-cpp] $env:REALTIMESTT_RUN_WHISPER_CPP 1 $env:REALTIMESTT_WHISPER_CPP_MODEL tiny.en $env:REALTIMESTT_WHISPER_CPP_MODEL_DIR Join-Path (Get-Location) test-model-cache\pywhispercpp python -m unittest -v tests.unit.test_whisper_cpp_engine.WhisperCppGoldenTranscriptionTeststest_whisper_cpp_engine.py 中的WhisperCppGoldenTranscriptionTests会把 WAV 样本转为float32 / 32768.0的归一化音频构造WhisperCppEngine模型默认tiny.en、beam size 默认 5转写后断言前两个词命中。该测试还要求 NumPy 可用否则会 skip。4.3 OpenAI Whisper Golden 测试python -m pip install openai-whisper $env:REALTIMESTT_RUN_OPENAI_WHISPER 1 $env:REALTIMESTT_OPENAI_WHISPER_MODEL tiny.en $env:REALTIMESTT_OPENAI_WHISPER_DEVICE cpu $env:REALTIMESTT_OPENAI_WHISPER_COMPUTE_TYPE float32 $env:REALTIMESTT_OPENAI_WHISPER_MODEL_DIR Join-Path (Get-Location) test-model-cache\openai-whisper python -m unittest -v tests.unit.test_openai_whisper_engine.OpenAIWhisperGoldenTranscriptionTests4.4 新一代模型家族的 opt-in Smoke 测试Parakeet/NeMo、Cohere、Granite Speech、Qwen3-ASR、Moonshine 等较新引擎族的冒烟测试集中在 test_additional_transcription_engines.py# 只打开你要验证的那个引擎即可 $env:REALTIMESTT_RUN_PARAKEET 1 $env:REALTIMESTT_RUN_COHERE_TRANSCRIBE 1 $env:REALTIMESTT_RUN_GRANITE_SPEECH 1 $env:REALTIMESTT_RUN_QWEN3_ASR 1 $env:REALTIMESTT_RUN_MOONSHINE 1 $env:REALTIMESTT_HF_MODEL_DIR Join-Path (Get-Location) test-model-cache\hf python -m unittest -v tests.unit.test_additional_transcription_engines.AdditionalEngineGoldenTranscriptionTests这些 smoke 测试需要numpy、各后端可选依赖及模型访问权限。特别注意Cohere 目前要求先接受 Hugging Face 的门控gated访问授权权重才能下载。4.5 sherpa-onnx先契约、后真实模型sherpa-onnx 的快速契约测试会 mock 运行时、不下载模型python -m pip install sherpa-onnx python -m unittest -v tests.unit.test_sherpa_onnx_engine若要拿到真实的 RTFReal-Time Factor对比数据需要先把 sherpa-onnx 模型包下载并解压到test-model-cache\sherpa-onnx下再运行对应的 opt-in smoke 测试。Parakeet 后端INT8$env:REALTIMESTT_RUN_SHERPA_ONNX_PARAKEET 1 $env:REALTIMESTT_SHERPA_ONNX_PARAKEET_MODEL Join-Path (Get-Location) test-model-cache\sherpa-onnx\sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8 $env:REALTIMESTT_SHERPA_ONNX_NUM_THREADS 2 python -m unittest -v tests.unit.test_sherpa_onnx_engine.SherpaOnnxGoldenTranscriptionTests.test_transcribes_fixture_with_real_sherpa_parakeet_backendMoonshine 后端INT8$env:REALTIMESTT_RUN_SHERPA_ONNX_MOONSHINE 1 $env:REALTIMESTT_SHERPA_ONNX_MOONSHINE_MODEL Join-Path (Get-Location) test-model-cache\sherpa-onnx\sherpa-onnx-moonshine-tiny-en-int8 $env:REALTIMESTT_SHERPA_ONNX_NUM_THREADS 1 python -m unittest -v tests.unit.test_sherpa_onnx_engine.SherpaOnnxGoldenTranscriptionTests.test_transcribes_fixture_with_real_sherpa_moonshine_backend4.6 同时跑两条 Golden 路径$env:REALTIMESTT_RUN_GOLDEN_TRANSCRIPTION 1 $env:REALTIMESTT_TEST_MODEL tiny $env:REALTIMESTT_TEST_DEVICE cpu $env:REALTIMESTT_TEST_COMPUTE_TYPE int8 $env:REALTIMESTT_RUN_WHISPER_CPP 1 $env:REALTIMESTT_WHISPER_CPP_MODEL tiny.en $env:REALTIMESTT_WHISPER_CPP_MODEL_DIR Join-Path (Get-Location) test-model-cache\pywhispercpp python -m unittest -v tests.unit.test_audio_fixtures tests.unit.test_whisper_cpp_engine4.7 Kroko-ONNX契约测试与真实模型 Community smokepython -m unittest -v tests.unit.test_kroko_onnx_engine python -m unittest -v tests.unit.test_realtime_streaming_transcription快速 Kroko 测试使用假运行时对象不安装、不导入 Kroko-ONNX。要跑真实模型Community 版的 smoke 测试需先安装 Kroko-ONNX 再 opt-in$env:REALTIMESTT_RUN_KROKO_ONNX 1 $env:REALTIMESTT_KROKO_ONNX_MODEL test-model-cache\kroko-onnx\Kroko-EN-Community-64-L-Streaming-001.data $env:REALTIMESTT_KROKO_ONNX_PROVIDER cpu $env:REALTIMESTT_KROKO_ONNX_NUM_THREADS 1 python -m unittest -v tests.unit.test_kroko_onnx_engine.KrokoOnnxGoldenTranscriptionTests若使用需要授权的 Pro 模型可设置REALTIMESTT_KROKO_ONNX_KEY、KROKO_ONNX_KEY或KROKO_KEY三者取其一。切勿把密钥写入命令历史、文档、生成报告或提交的文件中——这一点在 test_kroko_onnx_engine.py 的KROKO_ONNX_KEY_ENV_NAMES常量中同样体现。4.8 Omnilingual ASRLinux/WSL2 专属路径python -m unittest -v tests.unit.test_omnilingual_asr_engine这些测试使用假 Omnilingual 运行时对象不安装不导入 Meta 的 Omnilingual ASR 包。它属于源码检出source checkout命令——只有在源码树与测试同时存在时才能工作如果是干净 pip 安装的环境请改用 docs/engines/omnilingual-asr.md 中基于文件的 smoke 测试。真实模型 smoke 测试应在 Linux 或 WSL2 上运行使用 Python 3.11.x 及与之匹配的torch/torchaudio构建。从omniASR_CTC_1B_v2开始尝试如果遇到未知的_v2模型卡片应将其视为 Omnilingual 依赖版本不匹配而不是回退到旧的非 v2 卡片。源码检出下的运行方式python tests/realtimestt_omnilingual_test.py --file-smoke --device cudapip 安装场景请参照 docs/engines/omnilingual-asr.md 从对应发布分支下载独立脚本。五、FastAPI 多用户负载测试并发、公平调度与延迟指标RealtimeSTT 的 FastAPI 浏览器服务器见 example_fastapi_server包含两类测试快速假调度器测试与 opt-in 的真实引擎负载测试。5.1 快速假调度器测试python -m unittest -v tests.unit.test_fastapi_server_protocol tests.unit.test_fastapi_server_multi_user这两组测试覆盖会话隔离session isolation、公平调度fair scheduling、realtime 合并coalescing、过期 realtime 丢弃stale realtime discard、准入限制admission limits以及 clear/reset 行为。以 test_fastapi_server_protocol.py 为例它还验证了音频数据包的编解码往返encode_audio_packet/decode_audio_packet、非法包拒绝、sampleRate正整数校验、JSON 对象解析及带连字符的引擎名归一化如cohere-transcribetest_fastapi_server_multi_user.py 则验证了结构化实时文本稳定事件RealtimeTextStabilizationEvent到客户端消息字段segmentId、stableText、stableDelta、unstableText等的映射。5.2 opt-in 真实引擎负载测试该测试把 tests/unit/audio/asr-reference.wav51.9 秒、16 kHz 参考音频通过多个会话并行推流将最终文本与 asr-reference.expected_sentences.json 中的combined_normalized比对检查每个会话的延迟偏差并打印计时报告$env:REALTIMESTT_RUN_FASTAPI_MULTI_USER_PERF 1 $env:REALTIMESTT_FASTAPI_ASR_CLIENTS 2 $env:REALTIMESTT_FASTAPI_ASR_ENGINE faster_whisper $env:REALTIMESTT_FASTAPI_ASR_MODEL small.en python -m unittest -v tests.unit.test_fastapi_server_multi_user_asr_integrationREALTIMESTT_RUN_FASTAPI_MULTI_USER_ASR1会运行同一个测试PERF名称只是在测量延迟时更清晰的开关见 test_fastapi_server_multi_user_asr_integration.py 中run_real_asr_test_enabled的实现两者任一为真即启用。报告内容由build_performance_report生成结构可从 test_fastapi_server_multi_user_asr_integration.py 确认延迟类首个 realtime 延迟、首个 final 延迟、音频上传结束后的 final 延迟、首次 recording/VAD-start 计时、首个 realtime 相对 recording 开始的延迟、流发送时长、stop 调用时长节奏类realtime/final 事件的 p50/p95 节拍cadence质量类每个会话的 WER词错误率内部实现为 token 级编辑距离除以期望词数调度器类final 的 p50/p95 调度延迟、会话间的firstFinalLatencySkewMs与schedulerFinalP95SkewMs偏差计数类realtime/final 提交与完成数、合并的 realtime 数、丢弃的过期 realtime 数、被拒绝的任务数汇总类客户端数、模型就绪耗时、报告墙钟耗时、各延迟指标的 p50/p95、最大 WER。将报告另存为 JSON 以便跨运行对比$env:REALTIMESTT_FASTAPI_ASR_METRICS_JSON test-results\fastapi-multi-user-perf.json5.3 通过环境变量镜像手动服务器配置负载测试接受后端与调度器的整套调参变量从而能镜像一条手动启动的服务器命令。例如 sherpa-onnx Moonshine 在 CPU 上的配置$env:REALTIMESTT_RUN_FASTAPI_MULTI_USER_PERF 1 $env:REALTIMESTT_FASTAPI_ASR_CLIENTS 2 $env:REALTIMESTT_FASTAPI_ASR_ENGINE sherpa_onnx_moonshine $env:REALTIMESTT_FASTAPI_ASR_MODEL sherpa-onnx-moonshine-base-en-int8 $env:REALTIMESTT_FASTAPI_ASR_REALTIME_ENGINE sherpa_onnx_moonshine $env:REALTIMESTT_FASTAPI_ASR_REALTIME_MODEL sherpa-onnx-moonshine-tiny-en-int8 $env:REALTIMESTT_FASTAPI_ASR_DEVICE cpu $env:REALTIMESTT_FASTAPI_ASR_DOWNLOAD_ROOT test-model-cache\sherpa-onnx $env:REALTIMESTT_FASTAPI_ASR_ENGINE_OPTIONS {num_threads:4,provider:cpu} $env:REALTIMESTT_FASTAPI_ASR_REALTIME_ENGINE_OPTIONS {num_threads:2,provider:cpu} $env:REALTIMESTT_FASTAPI_ASR_REALTIME_PROCESSING_PAUSE 0.8 $env:REALTIMESTT_FASTAPI_ASR_REALTIME_USE_SYLLABLE_BOUNDARIES 1 $env:REALTIMESTT_FASTAPI_ASR_REALTIME_BOUNDARY_DETECTOR_SENSITIVITY 0.6 $env:REALTIMESTT_FASTAPI_ASR_REALTIME_BOUNDARY_FOLLOWUP_DELAYS 0.1,0.2,0.4 python -m unittest -v tests.unit.test_fastapi_server_multi_user_asr_integration.FastAPIMultiUserRealEngineASRTests要点引擎选项既接受 JSON 也接受keyvalue列表如num_threads4,providercpu。后者是 cmd 友好的写法可规避 Windows 引号转义问题。test_fastapi_server_multi_user_asr_integration.py 中的test_env_json_accepts_cmd_friendly_key_value_options和test_env_json_recovers_common_cmd_quote_forms专门验证了这两种解析路径包括对{num_threads:4}这类双引号转义形式的恢复。测试断言中默认max_wer为 0.30、max_latency_skew_ms为 30000均可通过环境变量覆盖并校验每个会话的finalCompleted 0及多会话时的 final p95 偏差上限。5.4 Windows cmd.exe 一键脚本针对 Windows cmd.exe 下最常见的 sherpa-onnx Moonshine 运行仓库提供了带默认值的辅助脚本 example_fastapi_server/run_multi_user_perf.cmd。它会从脚本所在目录跳转到仓库根目录执行python -m unittest默认设置 4 个客户端、sherpa-onnx Moonshine base/tiny 双模型、CPU 引擎选项等仅在环境变量未定义时才填充默认值因此可直接覆盖再运行set REALTIMESTT_FASTAPI_ASR_CLIENTS8 set REALTIMESTT_FASTAPI_ASR_METRICS_JSONtest-results\fastapi-8-user-perf.json example_fastapi_server\run_multi_user_perf.cmd更全面的REALTIMESTT_FASTAPI_ASR_*环境变量清单见 example_fastapi_server/README.md可用于选择 CPU sherpa-onnx Moonshine、whisper.cpp、Parakeet 或其他已安装后端。5.5 Kroko-ONNX 走同一 FastAPI 压测路径$env:REALTIMESTT_RUN_FASTAPI_MULTI_USER_PERF 1 $env:REALTIMESTT_FASTAPI_ASR_CLIENTS 2 $env:REALTIMESTT_FASTAPI_ASR_ENGINE kroko_onnx $env:REALTIMESTT_FASTAPI_ASR_MODEL test-model-cache\kroko-onnx\Kroko-EN-Community-64-L-Streaming-001.data $env:REALTIMESTT_FASTAPI_ASR_REALTIME_ENGINE kroko_onnx $env:REALTIMESTT_FASTAPI_ASR_REALTIME_MODEL test-model-cache\kroko-onnx\Kroko-EN-Community-64-L-Streaming-001.data $env:REALTIMESTT_FASTAPI_ASR_DEVICE cpu $env:REALTIMESTT_FASTAPI_ASR_ENGINE_OPTIONS providercpu,num_threads2 $env:REALTIMESTT_FASTAPI_ASR_REALTIME_ENGINE_OPTIONS providercpu,num_threads1 $env:REALTIMESTT_FASTAPI_ASR_METRICS_JSON test-results\kroko-onnx-fastapi-cpu-2clients.json python -m unittest -v tests.unit.test_fastapi_server_multi_user_asr_integration.FastAPIMultiUserRealEngineASRTests若要用 CUDA在确认当前安装的 Kroko-ONNX 构建支持 CUDA provider 之后把REALTIMESTT_FASTAPI_ASR_DEVICE及两个 provider 选项改为cuda即可。六、Windows 注意事项沙箱、权限与平台差异multiprocessing 管道权限部分录音器测试使用 multiprocessing 管道。在 Windows 上受限沙箱中可能无法创建 multiprocessing 队列/管道。若 Golden 测试在创建队列或管道时报PermissionError: [WinError 5] Zugriff verweigert拒绝访问请在普通终端中带上同样的环境变量重新运行。Parakeet/NeMo 与 Qwen vLLM 面向 Linux在 Windows 工作站做真实模型验证时建议在启用 CUDA 的 WSL2 Linux 环境中进行——安装可选后端依赖、把仓库挂载或克隆到 WSL 文件系统内然后运行相同的python -m unittest命令。默认 Windows 单元运行应聚焦 mock 契约测试这样本地检查与 CI 都不需要 GPU 驱动、门控模型访问或多 GB 级下载。七、为新增转录引擎添加测试当为 RealtimeSTT 引入新转录引擎时docs/testing.md 明确要求先写快速契约测试覆盖以下行为工厂选择与懒加载行为create_transcription_engine能按引擎名创建实例、可选后端在导入失败时不阻塞见 test_whisper_cpp_engine.py 的工厂测试与get_supported_transcription_engines()断言。缺少可选依赖时的报错信息mock 掉import_module抛ModuleNotFoundError断言抛出的TranscriptionEngineError包含pip install ...指引。TranscriptionEngineConfig到后端绑定的参数映射如beam_size1时切换 greedy 解码、engine_options中n_threads/single_segment透传、download_root映射到models_dir等。音频校验与归一化行为空音频拒绝、峰值归一化、use_prompt开关、token 提示词prompt_tokens/prompt_n_tokens传递。后端 segments 到TranscriptionResult的转换拼接文本、语言与置信度字段填充。只有快速契约测试稳定之后才添加真实模型的 Golden 测试并且必须用环境变量保持 opt-in——这是整个测试体系保持“日常快速、按需完整”的关键约定。八、测试路线图速查测试类型是否下载模型关键环境变量运行入口快速单元/契约测试否mock 后端无python -m unittest -v tests.unit.*全量命令faster-whisper Golden是REALTIMESTT_RUN_GOLDEN_TRANSCRIPTION1、REALTIMESTT_TEST_MODEL等tests.unit.test_audio_fixtures.GoldenTranscriptionTestswhisper.cpp Golden是REALTIMESTT_RUN_WHISPER_CPP1、REALTIMESTT_WHISPER_CPP_MODEL等tests.unit.test_whisper_cpp_engine.WhisperCppGoldenTranscriptionTestsOpenAI Whisper Golden是REALTIMESTT_RUN_OPENAI_WHISPER1等tests.unit.test_openai_whisper_engine.OpenAIWhisperGoldenTranscriptionTests新家族引擎 Smoke是REALTIMESTT_RUN_PARAKEET/_COHERE_TRANSCRIBE/_GRANITE_SPEECH/_QWEN3_ASR/_MOONSHINE1tests.unit.test_additional_transcription_engines.AdditionalEngineGoldenTranscriptionTestssherpa-onnx 契约/真实模型契约否、模型是REALTIMESTT_RUN_SHERPA_ONNX_PARAKEET/_MOONSHINE1tests.unit.test_sherpa_onnx_engineKroko-ONNX 契约/Community契约否、模型是REALTIMESTT_RUN_KROKO_ONNX1Pro 另加 KEYtests.unit.test_kroko_onnx_engine.KrokoOnnxGoldenTranscriptionTestsOmnilingual 契约否假运行时无smoke 在 Linux/WSL2tests.unit.test_omnilingual_asr_engineFastAPI 假调度器否无tests.unit.test_fastapi_server_protocol tests.unit.test_fastapi_server_multi_userFastAPI 真实引擎负载是REALTIMESTT_RUN_FASTAPI_MULTI_USER_PERF1及REALTIMESTT_FASTAPI_ASR_*系列tests.unit.test_fastapi_server_multi_user_asr_integration.FastAPIMultiUserRealEngineASRTests结合这套分层体系开发者既能在几秒内完成全部契约验证也能按需对任意转录引擎做真实音频的端到端质量与延迟评估而 FastAPI 多用户压测则把「并发公平性 延迟 p50/p95 WER」固化成了可重复、可导出 JSON 对比的自动化检查。相关手动演示与回归脚本如tests/final_transcription_gap_regression.py、tests/realtime_transcription_count_comparison.py详见 docs/test-scripts.md可与此处单元测试体系互补使用。【免费下载链接】RealtimeSTTA robust, efficient, low-latency speech-to-text library with advanced voice activity detection, wake word activation and instant transcription.项目地址: https://gitcode.com/GitHub_Trending/re/RealtimeSTT创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考