🎵 RhythmicTouch 音律触感

🎶 让马达随着音律而舞动 🎶

🔊 LSPosed 模块 · 从系统全局音频流中捕捉音乐节奏并触发马达振动

🔨 Build 📜 License: AGPL-3.0 📱 API

English · 中文


🏗️ 架构

┌──────────────┐         ┌──────────────────┐
│   SystemUI   │         │  App (如 Phira)   │
│  AudioTrack  │         │  Oboe / AAudio    │
└──────┬───────┘         └────────┬─────────┘
       │  Xposed Hook             │  C++ Native GOT Hook
       ▼                          ▼
┌─────────────────────────────────────────────┐
│             RhythmicEngine                  │
│  32-band FFT  →  Beat Analysis              │
│  Adaptive Threshold  +  Mode Matching       │
└─────────────────────┬───────────────────────┘
                      │
                      ▼
┌─────────────────────────────────────────────┐
│            VibratorDriver                   │
│  8 种振动模式 · Per-mode 频段过滤           │
└─────────────────────────────────────────────┘

🔗 双链路数据流

🔹 链路 🎯 Hook 目标 🎤 采集方式 📊 数据
SystemUI com.android.systemui Xposed Hook AudioTrack / AAudio 🎵 全局媒体音频流
App org.flos.phira C++ GOT Hook AAudioStream_write() 🎮 应用内 Oboe PCM 原始数据

两条链路的数据最终汇入同一个 RhythmicEngine,由 BeatAnalyzer 进行 32 频段 FFT 分析,再根据能量分布、节拍检测和自适应阈值匹配到振动模式,驱动马达。

✨ 功能

  • 🎛️ 32 频段 FFT 实时分析 — 基于 Oboe 原生音频采集,33ms 帧率
  • 📳 8 种振动模式 — 💥重长振 / 💢重短振 / 🎵中敲击 / ⚡中等击打 / 🎶上升轻击 / 🔊长脉动 / 🔄情感脉动 / ✨柔和细节
  • 🎚️ Per-mode 频段配置 — 每个模式独立设置触发频段范围或手动勾选频段
  • 📁 多配置文件系统 — 创建多个配置文件,按应用自动切换(scope-based)
  • 📤 配置文件导入导出 — 单个 JSON 或批量 ZIP 打包分享
  • 🧠 自适应阈值 — 根据历史能量动态调整触发灵敏度
  • 🌐 国际化 — 中英文双语 UI
  • 静默时段 — 定时关功能,在指定时间段内暂停触觉反馈
  • 🔧 Daemon 进程 — 后台服务,持续监听触觉反馈
  • 🎨 Miuix UI — Material You 动态取色主题

📋 环境要求

  • 🤖 Android 9+ (API 28+)
  • 🔧 LSPosed / EdXposed
  • com.android.systemui 作用域已勾选

📱 支持设备与系统

📱 设备 🤖 系统版本 📝 状态
OPPO Reno8 Pro ColorOS 14.0 ✅ 已验证
Nothing Phone (3) Android 16 ✅ 已验证

💡 欢迎提交新设备测试结果!其他机型请自测。

📥 安装

  1. ⬇️ 从 Releases 下载 APK
  2. 📦 在 LSPosed 中安装并启用模块
  3. ☑️ 勾选 com.android.systemui 作用域
  4. 🎮 (可选)勾选目标应用如 Phira 以启用 App 端原生采集
  5. 🔄 重启 SystemUI 或重启手机

🔨 编译

./gradlew assembleDebug

📦 APK 输出在 app/build/outputs/apk/debug/app-debug.apk

👤 作者

📜 License

GNU Affero General Public License v3.0

Releases

1.0.4

Stable

8/19/2026, 5:47:47 PM

📦 Changelog v1.0.4 (English)

The new binary embeds the RichTap SDK to make short‑vibration work properly on Xiaomi devices, which results in a larger app size 📈

v1.0.4: RichTap HD haptics, Oboe PCM fix, i18n, quiet period, daemon

✨ New Features

  • RichTap HD haptic engine integration (priority adaptation for Xiaomi devices)
  • MiHaptic reflection API exploration (HyperOS miui.os.DynamicEffect)
  • Scheduled quiet‑period toggle (QuietPeriodScreen) ⏱️
  • Daemon background service (rhythmic_daemon) 🔄
  • App internationalization (EN‑CN bilingual, ~170+ string resources) 🌐
  • In‑app language switcher (LocaleHelper) 🗣️

⚡ Improvements

  • Fixed Oboe PCM‑to‑FFT all‑zero data bug (drain thread dispatches valid frames only)
  • Improved Oboe pipeline stability (32K ring buffer + overflow detection + pre‑allocated arrays) 🛡️
  • Adaptive silence detection (dynamic peakEnergy threshold, SILENCE_RATIO=0.02) 📊
  • Removed BeatAnalyzer silence gate (fields kept for compatibility, no longer used)
  • VibratorDriver three‑level fallback chain (RichTap → MiHaptic → standard VibrationEffect) 🔁
  • Vibration hardware auto‑calibration (calibrate() probes minimum achievable interval) 📐
  • Automatic config value clamping for out‑of‑range inputs 🔧

📱 Device Compatibility

  • Exclusive RichTap / MiHaptic adaptation for Xiaomi devices (not fully tested) ⚠️
  • Validated on OPPO Reno8 Pro / Nothing Phone (3) ✅

🐛 Bug Fixes

  • Fixed MiHapticHelper getOrCreatePlayer() bug (inconsistent effect instance when useEffectArgConstructor=true)
  • Fixed allow‑/block‑list scope filtering bug
  • Fixed ZIP packaging issue for config import / export 📦

Full Changelog: LyonHyrik/RhythmicTouch@v1.0.3...v1.0.4


📦 v1.0.4 更新日志(中文)

由于新的包嵌入了RichTap SDK以使短震动在小米设备上正常进行,所以包的体积变大了📈

v1.0.4:RichTap HD 触觉、Oboe PCM 修复、国际化、静默时段、后台守护进程

✨ 新增功能

  • RichTap HD 触觉引擎集成(小米设备优先适配)
  • MiHaptic 反射 API 探索(HyperOS miui.os.DynamicEffect)
  • 静默时段定时关功能(QuietPeriodScreen)⏱️
  • Daemon 后台进程(rhythmic_daemon)🔄
  • 应用国际化(中英文双语,~170+ 字符串资源)🌐
  • 语言设置切换(LocaleHelper)🗣️

⚡ 优化改进

  • Oboe PCM → FFT 数据全零 bug 修复(drain thread 只发送有效帧)
  • Oboe 数据链路稳定性(ring buffer 32K + overflow 检测 + 预分配数组)🛡️
  • 自适应静音检测(peakEnergy 动态阈值,SILENCE_RATIO=0.02)📊
  • BeatAnalyzer 静音门控移除(保留字段但不再使用)
  • VibratorDriver 三级降级链(RichTap → MiHaptic → 标准 VibrationEffect)🔁
  • 振动硬件自动校准(calibrate() 探测最小可实现间隔)📐
  • 配置值自动修正(超出范围自动 clamp)🔧

📱 设备适配

  • 小米设备专属 RichTap/MiHaptic 适配(未充分测试)⚠️
  • OPPO Reno8 Pro / Nothing Phone (3) 已验证 ✅

🐛 Bug 修复

  • MiHapticHelper getOrCreatePlayer() bug(useEffectArgConstructor=true 时 effect 实例不一致)
  • 白/黑名单作用域过滤 bug
  • 配置导入导出 ZIP 打包问题 📦

完整变更记录: LyonHyrik/RhythmicTouch@v1.0.3...v1.0.4

Assets

1