跳到正文
DEV Community· devs·· 1 天前AI 評分42

在 Windows 建立雙音軌音訊管線:不加入通話,同時擷取咪高峯與系統音訊

Building a dual-track audio pipeline on Windows: mic + system audio without joining the call

AI 導讀

Windows 桌面應用程式可透過作業系統層級的音訊擷取,同時取得咪高峯和通話系統音訊,無須讓機械人加入會議。分開兩條音軌可讓語音轉文字引擎為雙方生成清晰逐字稿,並供介面並排顯示;兩條音軌須使用同一時鐘標記時間,以便對齊逐字稿。作者正開發 Talkaside,這是一款供求職面試及外語通話使用的 Windows 應用程式。

正文

Cover image for Building a dual-track audio pipeline on Windows: mic + system audio without joining the call

devs

When you want a desktop app that listens to a Zoom/Teams/Meet call and your own microphone without injecting a bot into the meeting, the only reliable path on Windows is OS-level audio capture.

Why two tracks

A single mixed stream loses who is speaking. For live translation or interview assistance you need:

  • Mic track — your voice
  • Loopback track — everything the other person says (system audio)

That separation lets the STT engine produce clean transcripts for each side and the UI show them side-by-side.

The capture stack

On Windows the practical combination is:

  1. cpal (Rust) or the equivalent in your language for device enumeration and stream opening.
  2. WASAPI loopback for the system audio (the call).
  3. Separate buffer management so the two streams stay time-aligned.

Windows core audio components

Windows 10/11 audio stack diagram

Key constraints

  • Exclusive mode vs shared mode changes latency and whether other apps can still play sound.
  • Sample rate conversion is almost always required (calls are often 16 kHz or 48 kHz, your pipeline may want 16 kHz for Whisper-class models).
  • You must handle device hot-plug and default-device changes mid-call.

Practical lessons

  • Buffer size is a latency vs stability trade-off. Too small and you get underruns; too large and the translation lags.
  • Always timestamp both tracks from the same clock so you can later align transcripts.
  • Test with headphones. Loopback that includes your own mic creates feedback loops that are painful to debug.

The result is a private, local pipeline: no meeting bot joins the call, both sides are heard, and the rest of the app (STT, translation, overlay) can work on clean streams.

I'm building Talkaside, a Windows app for job interviews and calls in another language.

Drafted with AI assistance from this project's code and logs.

來源:DEV Community · dev.to