Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(desktop): capture meeting audio without noise suppression
Elian Doran4fcf1ca5b980
diff --git a/.claude/skills/working-with-transcription/SKILL.md b/.claude/skills/working-with-transcription/SKILL.mdindex 63611f8a7c..9445eef34f 100644--- a/.claude/skills/working-with-transcription/SKILL.md+++ b/.claude/skills/working-with-transcription/SKILL.md@@ -111,6 +111,7 @@ On the first recording (two minutes of system audio, English interview), against- **Capture chunks must stay a multiple of 512 samples.** `VadSegmenter.accept()` feeds whole 512-sample windows and drops a remainder; 4096 divides evenly.- **`maxSpeechDuration` is not a hard cut**: past it, sherpa lowers the minimum silence to 0.1 s and raises the threshold to 0.9, so a segment ends at the next short gap, typically 1–2 s later.- **The capture window must be `offscreen`**: a hidden window renders no frames without it, and the self-capture that yields system audio times out. `getDisplayMedia()` needs a user gesture, which only `executeJavaScript(…, true)` gives a hidden window.+- **Chromium's audio processing is applied during capture**, so the WAV already holds it and no replay can switch it off. The system track runs with echo cancellation, noise suppression and auto gain all off; the microphone keeps echo cancellation, so the meeting played through speakers is not transcribed twice, and its auto gain. Earlier recordings, including the one under "Findings so far", had noise suppression on both tracks and echo cancellation on the system track, so do not compare transcripts across that change.- **A silent system source** usually means the sink's monitor volume is near zero (seen at -66 dB); the per-source peak logged every 5 s shows it.- **Prebuilds**: `sherpa-onnx-node` has none for win-arm64. `provider: "trt"` exits the process with an offline model.diff --git a/apps/desktop/src/services/transcription/capture.ts b/apps/desktop/src/services/transcription/capture.tsindex fdb7b18b68..8b7aaa2ce2 100644--- a/apps/desktop/src/services/transcription/capture.ts+++ b/apps/desktop/src/services/transcription/capture.ts@@ -140,7 +140,9 @@ function describe(tracks) {}async function captureMicrophone() {- const media = await navigator.mediaDevices.getUserMedia({ audio: { channelCount: 1 } });+ const media = await navigator.mediaDevices.getUserMedia({+ audio: { channelCount: 1, echoCancellation: true, noiseSuppression: false }+ });pipe("microphone", media);return describe(media.getAudioTracks());}@@ -148,7 +150,7 @@ async function captureMicrophone() {async function captureSystemAudio() {const media = await navigator.mediaDevices.getDisplayMedia({video: true,- audio: { echoCancellation: true, noiseSuppression: true, autoGainControl: false }+ audio: { echoCancellation: false, noiseSuppression: false, autoGainControl: false }}).catch((e) => {throw new Error(e.name + ": " + e.message);});