Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
feat(meeting): enable live speaker identification for Windows loopback capture
Chadpiha53a4e774238f
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.jsindex 36771fa03..24e6d8e41 100644--- a/src/helpers/ipcHandlers.js+++ b/src/helpers/ipcHandlers.js@@ -32,6 +32,7 @@ const { getTinfoilChatModels } = require("./tinfoilCatalog");const { transcribeWithTinfoil } = require("./tinfoilTranscription");const AudioStorageManager = require("./audioStorage");const liveSpeakerIdentifier = require("./liveSpeakerIdentifier");+const { supportsLiveSpeakerIdentification } = require("./liveSpeakerIdPolicy");const MeetingEchoLeakDetector = require("./meetingEchoLeakDetector");const { partitionPendingMicFinals, isWithinRetractWindow } = require("./meetingMicHoldback");const { applySmartSpacing } = require("./smartSpacing");@@ -6166,7 +6167,10 @@ class IPCHandlers {const startLiveSpeakerIdentification = async (win, systemAudioMode) => {await stopLiveSpeakerIdentification();- if (systemAudioMode !== "native" || !liveSpeakerIdentifier.isAvailable()) {+ if (+ !supportsLiveSpeakerIdentification(systemAudioMode) ||+ !liveSpeakerIdentifier.isAvailable()+ ) {return false;}diff --git a/src/helpers/liveSpeakerIdPolicy.js b/src/helpers/liveSpeakerIdPolicy.jsnew file mode 100644index 000000000..1efbd54c0--- /dev/null+++ b/src/helpers/liveSpeakerIdPolicy.js@@ -0,0 +1,12 @@+// Whether live speaker identification can run for the given meeting system+// audio mode.+//+// "native" (macOS Core Audio tap) and Windows "loopback" (WASAPI helper or+// renderer display-media fallback) all deliver 24 kHz mono s16le PCM through+// the same sendMeetingAudio("system") path, so the identifier works unchanged.+// Linux reports "loopback" too (PipeWire portal) but that capture path has not+// been verified against the identifier yet, so it stays disabled.+export function supportsLiveSpeakerIdentification(systemAudioMode, platform = process.platform) {+ if (systemAudioMode === "native") return true;+ return systemAudioMode === "loopback" && platform === "win32";+}diff --git a/test/helpers/liveSpeakerIdPolicy.test.js b/test/helpers/liveSpeakerIdPolicy.test.jsnew file mode 100644index 000000000..d19ed72fb--- /dev/null+++ b/test/helpers/liveSpeakerIdPolicy.test.js@@ -0,0 +1,51 @@+const test = require("node:test");+const assert = require("node:assert/strict");++const load = () => import("../../src/helpers/liveSpeakerIdPolicy.js");++test("native system audio (macOS tap) supports live speaker identification", async () => {+ const { supportsLiveSpeakerIdentification } = await load();++ for (const platform of ["darwin", "win32", "linux"]) {+ assert.equal(supportsLiveSpeakerIdentification("native", platform), true);+ }+});++test("Windows loopback supports live speaker identification", async () => {+ const { supportsLiveSpeakerIdentification } = await load();++ // Both Windows strategies (WASAPI helper and renderer display-media+ // fallback) report mode "loopback" and feed the same 24 kHz mono s16le+ // sendMeetingAudio path as the macOS native tap.+ assert.equal(supportsLiveSpeakerIdentification("loopback", "win32"), true);+});++test("Linux loopback (PipeWire portal) stays disabled until verified", async () => {+ const { supportsLiveSpeakerIdentification } = await load();++ assert.equal(supportsLiveSpeakerIdentification("loopback", "linux"), false);+});++test("unsupported mode never identifies speakers", async () => {+ const { supportsLiveSpeakerIdentification } = await load();++ for (const platform of ["darwin", "win32", "linux"]) {+ assert.equal(supportsLiveSpeakerIdentification("unsupported", platform), false);+ }+});++test("missing mode never identifies speakers", async () => {+ const { supportsLiveSpeakerIdentification } = await load();++ assert.equal(supportsLiveSpeakerIdentification(undefined, "win32"), false);+ assert.equal(supportsLiveSpeakerIdentification(null, "darwin"), false);+});++test("platform defaults to the current process platform", async () => {+ const { supportsLiveSpeakerIdentification } = await load();++ assert.equal(+ supportsLiveSpeakerIdentification("loopback"),+ supportsLiveSpeakerIdentification("loopback", process.platform)+ );+});