Skip to content

ZhaoChaoqun/nano-typeless

Repository files navigation

Nano Typeless

按下即说,语音秒变文字
基于本地 AI 的 macOS 原生语音输入工具

Platform Swift License ASR Engines

功能特性安装方法使用方法项目架构参与贡献

English


🎬 演示视频

TypelessPromoV2-4K.mp4

✨ 功能特性

功能 描述
🎤 按键说话 按住 Fn 键录音,松开即转文字
🔒 完全本地 所有模型完全在本地运行,数据不出设备
🌐 中英混合 双引擎均原生支持中英文混合输入
快速轻量 菜单栏应用,资源占用极低
🎯 通用输入 任意应用可用 - 光标在哪,文字就输入到哪
💻 通用版本 同时支持 Apple Silicon (M1/M2/M3/M4) 和 Intel Mac

🖥️ 系统要求

要求 规格
系统 macOS 14.0 (Sonoma) 或更高版本
芯片 Apple Silicon (M1/M2/M3/M4) 或 Intel - 通用版本支持
内存 建议 8GB 以上

说明:Apple Silicon Mac 将利用神经网络引擎加速推理。Intel Mac 使用 CPU 推理,功能完整。

📦 安装方法

通过 Homebrew 安装(推荐)

# 安装
brew tap ZhaoChaoqun/typeless && brew install --cask nano-typeless

升级

# 升级到最新版本
brew update && brew upgrade nano-typeless

从源码编译

# 克隆仓库
git clone https://github.com/ZhaoChaoqun/nano-typeless.git
cd nano-typeless

# 用 Xcode 打开
open Typeless.xcodeproj

# 或命令行编译
xcodebuild -project Typeless.xcodeproj -scheme Typeless build

首次启动设置

首次启动需要授予两个权限:

权限 用途 如何开启
🎙️ 麦克风 录制语音 系统弹窗(自动)
辅助功能 监听全局 Fn 系统设置 → 隐私与安全性 → 辅助功能

提示:授予辅助功能权限后,可能需要重启应用。

🚀 使用方法

快速开始

  1. 启动 Nano Typeless - 出现在菜单栏
  2. 按住 Fn 键开始说话
  3. 松开 Fn 键完成录音
  4. 文字 自动插入到光标位置

使用流程

[按住 Fn] → "你好,这是一个测试" → [松开 Fn]
                    ↓
         "你好,这是一个测试" 出现在光标处

状态指示

状态 指示器
就绪 🎵 菜单栏图标
录音中 🔴 视觉遮罩
处理中 ⏳ 加载指示器

🏗️ 项目架构

typeless/
├── Sources/
│   ├── TypelessApp.swift          # 应用入口和生命周期
│   ├── RecordingManager.swift     # 音频录制和引擎调度
│   ├── RecordingState.swift       # 录音状态机管理
│   ├── ASREngine.swift            # ASR 引擎统一协议
│   ├── ASRStreamRecognizing.swift # 流式识别器协议
│   ├── SherpaOnnxOnlineRecognizer.swift # Streaming Paraformer 流式识别
│   ├── QwenASRRecognizer.swift    # Qwen3-ASR 流式识别
│   ├── SherpaOnnxManager.swift    # 模型下载和管理
│   ├── SherpaOnnxPunctuation.swift # CT-Transformer 标点模型
│   ├── CloudRewriter.swift        # 云端 LLM 文本纠错
│   ├── Qwen3TextRewriter.swift    # Qwen3-0.6B 本地文本纠错
│   ├── TermNormalizer.swift       # 词典后处理(术语规范化)
│   ├── KeyMonitor.swift           # 全局 Fn 键检测
│   ├── TextInserter.swift         # 光标文字插入
│   ├── OverlayWindow.swift        # 录音 UI 遮罩
│   └── SettingsView.swift         # 偏好设置 UI
├── Frameworks/
│   ├── sherpa-onnx/               # Paraformer 推理框架
│   ├── qwen-asr/                  # Qwen3-ASR Rust FFI 库
│   └── qwen3-rewrite/             # Qwen3-0.6B 文本纠错 C FFI 库
├── Package.swift                  # Swift Package 依赖
└── Typeless.xcodeproj/            # Xcode 项目

技术栈

组件 技术
UI 框架 SwiftUI
语音识别 sherpa-onnx (Streaming Paraformer) / Qwen3-ASR (Rust FFI)
文本后处理 Cloud LLM Rewriter / Qwen3-0.6B 本地纠错 / 词典规范化
音频采集 AVFoundation
按键监听 CGEvent Tap API
文字插入 CGEvent(键盘模拟)

工作原理

┌─────────────┐     ┌──────────────┐     ┌─────────────┐     ┌──────────────┐
│  Fn 键      │────▶│   录制       │────▶│   ASR 引擎  │────▶│   插入       │
│  监听       │     │   音频       │     │   转写      │     │   文字       │
└─────────────┘     └──────────────┘     └─────────────┘     └──────────────┘
    CGEvent           AVFoundation         本地 AI           CGEvent

🔧 配置说明

应用内置两种 ASR 引擎,可在设置中切换。默认使用 Streaming Paraformer

引擎 大小 模式 标点 适用场景
Streaming Paraformer ~414MB(含标点模型) 流式 CT-Transformer 日常使用(默认)
Qwen3-ASR ~834MB 流式 自带标点 高精度,长文本

🤝 参与贡献

欢迎贡献!请随时提交 Pull Request。

  1. Fork 本仓库
  2. 创建功能分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 提交 Pull Request

📄 许可证

本项目基于 MIT 许可证开源 - 详见 LICENSE 文件。

🔗 关联项目

Nano Typeless 的部分能力由以下子项目提供支持:

项目 说明 语言
QwenASR Qwen3-ASR 流式推理引擎,编译为 dylib 供本项目调用 Rust
mlx-qwen-asr-streaming Qwen3-ASR 流式推理的 MLX 实现,用于 Apple Silicon 上的快速实验 Python
Qwen3-0.6B Qwen3 0.6B 微调模型,支持 ASR 文本二阶段 rewrite(纠错+格式化) Python
sherpa-onnx sherpa-onnx fork,修复 Streaming Paraformer 流式尾部截断问题 C++

🙏 致谢

  • FunASR - 阿里达摩院开源语音识别模型
  • sherpa-onnx - 跨平台语音识别推理框架
  • Qwen3-ASR - 通义千问大模型语音识别

English

Press. Speak. Type.
A native macOS voice-to-text tool powered by local AI

FeaturesInstallationUsageArchitectureContributing


🎬 Demo

TypelessPromoV2-4K.mp4

✨ Features

Feature Description
🎤 Push-to-Talk Hold Fn key to record, release to transcribe
🔒 100% Local All models run entirely on-device, no data leaves your Mac
🌐 Multilingual Two ASR engines with native Chinese-English mixed input support
Fast & Lightweight Menu bar app with minimal resource usage
🎯 Universal Input Works in any app - just position your cursor and speak
💻 Universal Binary Runs natively on both Apple Silicon (M1/M2/M3/M4) and Intel Macs - one app, all Macs

🖥️ System Requirements

Requirement Specification
OS macOS 14.0 (Sonoma) or later
Chip Apple Silicon (M1/M2/M3/M4) or Intel - Universal Binary supported
RAM 8GB+ recommended

Note: Apple Silicon Macs will utilize the Neural Engine for faster inference. Intel Macs use CPU-based inference with full functionality.

📦 Installation

Install via Homebrew (Recommended)

# Install
brew tap ZhaoChaoqun/typeless && brew install --cask nano-typeless

Upgrade

# Upgrade to latest version
brew update && brew upgrade nano-typeless

Build from Source

# Clone the repository
git clone https://github.com/ZhaoChaoqun/nano-typeless.git
cd nano-typeless

# Open in Xcode
open Typeless.xcodeproj

# Or build via command line
xcodebuild -project Typeless.xcodeproj -scheme Typeless build

First Launch Setup

On first launch, you'll need to grant two permissions:

Permission Purpose How to Enable
🎙️ Microphone Record your voice System Prompt (automatic)
Accessibility Listen for global Fn key System Settings → Privacy & Security → Accessibility

Tips: After granting Accessibility permission, you may need to restart the app.

🚀 Usage

Quick Start

  1. Launch Nano Typeless - it appears in your menu bar
  2. Hold the Fn key and start speaking
  3. Release the Fn key when done
  4. Text is automatically inserted at cursor position

Workflow Example

[Hold Fn] → "Hello, this is a test" → [Release Fn]
                    ↓
         "Hello, this is a test" appears at cursor

Status Indicators

State Indicator
Ready 🎵 Menu bar icon
Recording 🔴 Visual overlay
Processing ⏳ Loading indicator

🏗️ Architecture

typeless/
├── Sources/
│   ├── TypelessApp.swift          # App entry & lifecycle
│   ├── RecordingManager.swift     # Audio recording & engine dispatch
│   ├── RecordingState.swift       # Recording state machine
│   ├── ASREngine.swift            # Unified ASR engine protocol
│   ├── ASRStreamRecognizing.swift # Stream recognizer protocol
│   ├── SherpaOnnxOnlineRecognizer.swift # Streaming Paraformer
│   ├── QwenASRRecognizer.swift    # Qwen3-ASR streaming recognition
│   ├── SherpaOnnxManager.swift    # Model download & management
│   ├── SherpaOnnxPunctuation.swift # CT-Transformer punctuation
│   ├── CloudRewriter.swift        # Cloud LLM text correction
│   ├── Qwen3TextRewriter.swift    # Qwen3-0.6B local text correction
│   ├── TermNormalizer.swift       # Dictionary post-processing (term normalization)
│   ├── KeyMonitor.swift           # Global Fn key detection
│   ├── TextInserter.swift         # Cursor text insertion
│   ├── OverlayWindow.swift        # Recording UI overlay
│   └── SettingsView.swift         # Preferences UI
├── Frameworks/
│   ├── sherpa-onnx/               # Paraformer inference framework
│   ├── qwen-asr/                  # Qwen3-ASR Rust FFI library
│   └── qwen3-rewrite/             # Qwen3-0.6B text correction C FFI library
├── Package.swift                  # Swift Package dependencies
└── Typeless.xcodeproj/            # Xcode project

Tech Stack

Component Technology
UI Framework SwiftUI
Speech Recognition sherpa-onnx (Streaming Paraformer) / Qwen3-ASR (Rust FFI)
Post-Processing Cloud LLM Rewriter / Qwen3-0.6B local correction / Term normalization
Audio Capture AVFoundation
Key Monitoring CGEvent Tap API
Text Insertion CGEvent (Keyboard Simulation)

How It Works

┌─────────────┐     ┌──────────────┐     ┌─────────────┐     ┌──────────────┐
│  Fn Key     │────▶│   Record     │────▶│  ASR Engine │────▶│   Insert     │
│  Monitor    │     │   Audio      │     │  Transcribe │     │   Text       │
└─────────────┘     └──────────────┘     └─────────────┘     └──────────────┘
    CGEvent           AVFoundation         Local AI           CGEvent

🔧 Configuration

The app includes two built-in ASR engines, switchable in Settings. Default is Streaming Paraformer.

Engine Size Mode Punctuation Best For
Streaming Paraformer ~414MB (incl. punct model) Streaming CT-Transformer Daily use (default)
Qwen3-ASR ~834MB Streaming Built-in High accuracy, long text

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Related Projects

Some capabilities of Nano Typeless are powered by these sub-projects:

Project Description Language
QwenASR Qwen3-ASR streaming inference engine, compiled as dylib for this project Rust
mlx-qwen-asr-streaming MLX implementation of Qwen3-ASR streaming inference for rapid prototyping on Apple Silicon Python
Qwen3-0.6B Fine-tuned Qwen3 0.6B model for two-stage ASR text rewriting (correction + formatting) Python
sherpa-onnx sherpa-onnx fork with fix for Streaming Paraformer tail truncation issue C++

🙏 Acknowledgments

  • FunASR - Alibaba DAMO Academy's open-source speech recognition model
  • sherpa-onnx - Cross-platform speech recognition inference framework
  • Qwen3-ASR - Qwen large model speech recognition

Made with ❤️ for the macOS community

About

Mac voice-to-text input tool using local FunASR model

Resources

Stars

15 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors