GlassMic v1.3.4.7
🚀 本次更新带来了全新重构的高保真音频重采样引擎、实时耳返监听功能、在线游戏(如 Roblox)硬实时低延迟优化,以及更直观的全链路推流状态可视化与 TTS 本地试听体验。
🚀 This release introduces a newly refactored Hi-Fi audio resampling engine, real-time audio monitoring, hard real-time low-latency optimizations for online games, full-pipeline streaming status awareness, and local TTS preview capabilities.
🇨🇳 中文更新日志 (Changelog)
🎵 音频核心引擎与高保真重采样 (Hi-Fi Resampling)
-
Windowed-Sinc FIR 抗混叠低通滤波:引入基于 Blackman-Harris 窗的 27 阶低通滤波器,自动在下采样($48\text{k}\to 16\text{k}$ /
$44.1\text{k}\to 16\text{k}$ )时滤除奈奎斯特极限以上的镜像混叠能量,彻底解决微信语音等场景的破音、金属毛刺和高频嘶嘶杂音[cite: 1]。 - 亚采样点级线性插值与连续流处理:消除阶梯时域伪影,跨分块严格保持滤波器延迟线与时钟游标连续,实现零爆音平滑过渡[cite: 1]。
- 防削波软拐点限幅器 (Soft Knee Limiter):引入双曲正切软过渡限幅算法,防止动态峰值过冲导致的方波削波失真[cite: 1]。
-
底层解码与 Native 优化:重构
FileAudioSource解码链路统一接入高质量重采样混音[cite: 1];优化glass_aaudio.cpp原生拦截路径音质[cite: 1]。
🎧 实时耳返监听 (Audio Monitor)
- 低延迟本地监听 (
AudioMonitorPlayer):基于高响应AudioTrack实现耳机/扬声器实时监听,与虚拟麦克风广播严格同步,所听即所录[cite: 1]。 - 独立音量控制与持久化:Proto 配置与设置页支持 0%~100% 独立音量调节并持久化保存[cite: 1]。
- 悬浮窗快捷开关:在 MiniBar 与 TTS 面板集成 🎧 耳返快捷开关,支持一键启闭[cite: 1]。
⚡ 在线/直播游戏硬实时低延迟优化
- SPSC 无锁环形缓冲区 (
SpscRingBuffer):Native 端实现 256 KB SPSC 无锁环形缓冲区与独立读取线程,硬实时音频回调与 IPC 管道 I/O 完全解耦,彻底消除 Buffer Underrun / XRun 卡顿[cite: 1]。 - 欠载平滑补偿 (PLC):优化欠载时的舒适噪声填充与真实采样率映射,杜绝音频时间拉伸变调与漏音[cite: 1]。
- 线程调度与保活:音频推流线程优先级提升至
URGENT_AUDIO,切片精细化至 20ms(1920 字节),前台服务增加Partial WakeLock防止系统休眠断流[cite: 1]。
👁️ 全链路推流状态感知与动效可视化
- 实时推流感知 (
isStreaming):动态监测目标应用是否正在实际录音取流[cite: 1]。 - 悬浮球 (Floating Bubble) 动效:新增推流脉冲呼吸动效与高亮绿点,统一支持 FILE / TTS 环形进度展示[cite: 1]。
- 悬浮窗 MiniBar & 主页:增加「● 录制推流中 / ○ 待命中」实时状态指示与精准时间戳进度同步[cite: 1]。
🗣️ TTS 本地试听与交互升级
- 独立本地试听 (
togglePreviewTts):支持直接通过扬声器/耳机试听合成语音,不占用虚拟麦克风推流管线[cite: 1]。 - TTS 面板重构:集成「🔊 试听 / ⏹ 停止」按钮、耳返快捷开关与实时进度调节条[cite: 1]。
- 国际化适配:补齐中英文多语言文案与提示支持[cite: 1]。
🌐 English Changelog
🎵 Audio Engine & Hi-Fi Resampling
-
Windowed-Sinc FIR Anti-Aliasing Filter: Implemented a 27th-order Blackman-Harris windowed low-pass filter that eliminates mirror aliasing above the Nyquist limit during downsampling (
$48\text{k}\to 16\text{k}$ /$44.1\text{k}\to 16\text{k}$ ), completely fixing harsh sibilance, metallic artifacts, and hissing in WeChat voice messages[cite: 1]. - Sub-sample Linear Interpolation: Replaced nearest-neighbor truncation with fractional-sample interpolation and persistent filter delay lines across chunks to ensure zero-pop, seamless transitions[cite: 1].
-
Soft Knee Limiter: Added a
tanh-based soft limiter after interpolation to prevent clipping distortion caused by peak overshoot[cite: 1]. -
Native & Pipeline Refactoring: Overhauled
FileAudioSourcewith streaming resampling[cite: 1]; optimizedglass_aaudio.cppnative audio conversion pipeline[cite: 1].
🎧 Real-time Audio Monitoring
- Low-Latency Monitor Engine (
AudioMonitorPlayer): Real-time audio playback through headphones/speakers synchronized with the virtual mic broadcast loop[cite: 1]. - Volume Control & Persistence: Added a 0%–100% volume slider and toggle with Proto configuration persistence[cite: 1].
- Floating Window Shortcuts: Added a 🎧 quick toggle in both MiniBar and TTS panels[cite: 1].
⚡ Real-Time Latency Optimizations for Online Games
- SPSC Lock-Free Ring Buffer (
SpscRingBuffer): 256 KB native SPSC ring buffer decoupled from IPC pipe I/O via a dedicated worker thread, completely eliminating audio underrun / XRun stutters[cite: 1]. - Packet Loss Concealment (PLC): Refined comfort noise generation and sample rate mapping during underruns to prevent audio pitch shifts and missing samples[cite: 1].
- Thread Scheduling & WakeLock: Elevated audio publisher thread priority to
URGENT_AUDIO, refined slicing down to 20ms (1920 bytes), and addedPartial WakeLockto prevent background sleep interruptions[cite: 1].
👁️ Streaming Awareness & Visual Indicators
- Real-time Streaming Detection (
isStreaming): Dynamically monitors target application consumption and recording states[cite: 1]. - Floating Bubble Upgrades: Added pulse breathing animations, glowing green status dots, and unified circular progress rings for both FILE and TTS modes[cite: 1].
- MiniBar & HomeScreen: Real-time indicators ("● Streaming / ○ Idle") and timestamp progress bars[cite: 1].
🗣️ TTS Local Preview & UI Refinements
- Local Preview (
togglePreviewTts): Listen to synthesized speech locally without occupying or interfering with the active virtual mic stream[cite: 1]. - Redesigned TTS Panel: Integrated "🔊 Preview / ⏹ Stop" controls, monitor switch, and progress slider[cite: 1].
- Localization: Full internationalization support for Simplified Chinese and English[cite: 1].
📦 Git Commits & Changes Summary
743503dFollow up version bump (v1.3.4.7)[cite: 1]ae39218fix(audio): Refactor audio resampling engine, fix 16kHz aliasing & distortion issues[cite: 1]6f411fffeat: Support real-time audio monitor, streaming awareness, and local TTS preview[cite: 1]6205b15Code style & cleanups[cite: 1]b97e804Optimize virtual mic stuttering and dropouts in online/live games[cite: 1]
📊 Stats: 22 files changed, +1384 insertions, -346 deletions[cite: 1].