[asr] macOS 26+ 桌面端支持 Apple 新语音引擎 SpeechAnalyzer(SpeechTranscriber)

Đang mở
#1,278 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust, tauri
Lĩnh vực
audio-video-rtc, backend

Hướng nghiên cứu

Read the existing iOS implementation at openless-all/ios/App/Speech/ModernAppleSpeechService.swift and trace how the desktop ASR engine list and settings report model download progress. Check the macOS Speech framework availability and AssetInventory APIs, then compare the desktop fallback path using SFSpeechRecognizer. Done means macOS 26+ can use the new engine with model download status and punctuation, while older macOS versions or unavailable models fall back to the existing engine.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

现象

  • 环境:macOS 26.6(25G72)、Apple M5 Pro、OpenLess 2.0.1(aarch64 DMG)。

  • 桌面端 ASR 选择 “Apple Speech” 后,日志显示走的是旧的 SFSpeechRecognizer:

    [apple-speech] recognizer locale = zh-CN
    [apple-speech] on-device recognition enabled
    [apple-speech] starting recognitionTaskWithRequest
    
  • 仓库里 iOS 端已有 openless-all/ios/App/Speech/ModernAppleSpeechService.swift,用的是 macOS 26 / iOS 26 新增的 SpeechAnalyzer + SpeechTranscriber;macOS 桌面端没有对应实现。

  • 本机查询 SpeechTranscriber.supportedLocales 包含 zh_CN、zh_TW、zh_HK、yue_CN。首次使用时通过 AssetInventory 下载普通话模型,很快就能用。

  • 用同一段 27 秒的普通话录音(夹了几个英文词)在本机对比了三种方式:

    旧引擎(OpenLess 当前行为) 旧引擎 + addsPunctuation = true SpeechTranscriber(.transcription 预设)
    中文汉字 全对 全对 全对
    标点 没有 只有 3 个逗号 有逗号和句号(一处句号位置不对)
    英文词 Claude 一次识别成「靠的」 同左 Claude → cloud,Option → opsin(英文专名两边都不准)
    耗时 0.5 秒 0.5 秒 0.2 秒

    只测了一段录音,结果仅供参考。

  • 公开资料:英文 LibriSpeech 上,SpeechAnalyzer 的 WER 是 2.12%,SFSpeechRecognizer 是 9.02%(https://www.developersdigest.tech/blog/apple-speechanalyzer-vs-whisper-benchmark )。另有开源项目 SoulZhong/voice-notes 的 PR 246 在 M5 Pro 上用 10 分钟中文会议实测:SpeechTranscriber 峰值内存约 140MB,SenseVoice 约 1.3GB,两者中文准确率在同一档。

影响

  • 桌面端选 Apple Speech 的用户,用到的是和系统听写同一套旧模型:没有标点,识别准确度也比新引擎差。
  • 想要“不用 API key、离线、内存小”的中文用户,桌面端目前缺一个合适的选项:本地 Qwen3-ASR / SenseVoice 内存在 1GB 级别,云端引擎又要自备密钥。
  • iOS 已经接入新引擎,桌面端没有,两端体验不一致。

建议接受标准

  • macOS 26 及以上,桌面端 ASR 引擎列表里可以选择基于 SpeechAnalyzer + SpeechTranscriber 的 Apple 新引擎(可复用 iOS 端 ModernAppleSpeechService 的逻辑)
  • 首次使用时通过 AssetInventory 检查并下载对应语言的模型,设置页显示下载进度和失败提示
  • macOS 26 以下或模型不可用时,回退到现有的 SFSpeechRecognizer 实现
  • 普通话(zh_CN)录音能输出带标点的结果
  • (可顺带)现有 SFSpeechRecognizer 路径设置 addsPunctuation = true,或提供开关

TODO / 不确定项

  • 公开资料说 SpeechTranscriber 不支持自定义词汇,它和 OpenLess 现有的词典 / 热词功能怎么配合,待确认。
  • 用 .transcription 还是 .progressiveTranscription 预设(后者能边说边出字),待定。
  • 新引擎的识别在系统进程里运行,OpenLess 自身的内存变化待实测。
Ngôn ngữ chính
Rust
Star
3.7k
Fork
349
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
100

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Open-Less/openless

Tất cả issue của Open-Less/openless

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.