Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.
TypeScript ai-meeting-assistantai-notetakerelectrongranola-alternativelinuxllama-cpplocal-ailocal-firstmacosmcpmeeting-minutesmeeting-notesoffline-firstopen-sourceprivacyspeech-to-texttranscriptionwhisperwhisper-cppwindows
Auto end: stop eight seconds after the call window closes, even if people keep talking
Eric Brownrout07e798feb33a
diff --git a/app/e2e/autoStop.spec.ts b/app/e2e/autoStop.spec.tsindex 32126c27..15cc1b92 100644--- a/app/e2e/autoStop.spec.ts+++ b/app/e2e/autoStop.spec.ts@@ -180,8 +180,8 @@ test('FaceTime audio/video and handed-off calls offer a card for the shared mic})-test('speech keeps recording after the app leaves the mic; only confirmed silence lets it stop', async () => {- const { app, page } = await launch()+test('without window evidence, losing the mic requires a quiet minute to stop', async () => {+ const { app, page, userData } = await launch()try {await callAndRecord(app, page)await fake(app, 'silence', 0)@@ -193,5 +193,6 @@ test('speech keeps recording after the app leaves the mic; only confirmed silencawait expect(page.getByTestId('note-state')).toHaveAttribute('data-state', 'recording')await fake(app, 'silence', 60_000)await expect(page.getByTestId('note-state')).toHaveAttribute('data-state', /^(stopped|done)$/)+ await expect.poll(() => readFileSync(join(userData, 'logs/main.log'), 'utf8')).toMatch(/CALL gone [^\n]*via=mic window_ms=0/)} finally { await app.close() }})diff --git a/app/src/main/detect.ts b/app/src/main/detect.tsindex 4404cf21..c564540d 100644--- a/app/src/main/detect.ts+++ b/app/src/main/detect.ts@@ -160,6 +160,4 @@ export function callGone(o: { app: string | null; seen: boolean; micIdleMs: numb* never counts a window that is only minimised or on another desktop.*/export const WINDOW_GONE_MS = 8_000-/** with the window gone, both tracks quiet this long: people still talking in the room are never cut off */-export const WINDOW_QUIET_MS = 15_000-export const windowGone = (o: { goneMs: number; silentMs: number }): boolean => o.goneMs >= WINDOW_GONE_MS && o.silentMs >= WINDOW_QUIET_MS+export const windowGone = (goneMs: number): boolean => goneMs >= WINDOW_GONE_MSdiff --git a/app/src/main/watch.ts b/app/src/main/watch.tsindex c4e28aa5..76845df3 100644--- a/app/src/main/watch.ts+++ b/app/src/main/watch.ts@@ -155,10 +155,10 @@ export class Watcher {r.windowLogAt = nowconsole.info(`CALL window-gone meeting=${m.id} app=${m.app} window_ms=${goneMs} on_mic=${onMic} mic=${mic} silent_ms=${silentMs}`)} else if (goneMs === 0) r.windowLogAt = undefined- const byWindow = windowGone({ goneMs, silentMs })+ const byWindow = windowGone(goneMs)const byMic = !r.byHand && callGone({ app: m.app, seen: r.seen, micIdleMs: now - r.lastMic, silentMs, graceMs: this.d.graceMs })if ((byWindow || byMic) && this.d.autoStop && this.d.autoStopOn?.()) {- console.info(`CALL gone meeting=${m.id} app=${m.app} idle_ms=${now - r.lastMic} silent_ms=${silentMs} via=${byMic ? 'mic' : 'window'} window_ms=${goneMs} mic=${mic}`)+ console.info(`CALL gone meeting=${m.id} app=${m.app} idle_ms=${now - r.lastMic} silent_ms=${silentMs} via=${byWindow ? 'window' : 'mic'} window_ms=${goneMs} mic=${mic}`)r.stopped = trueif (this.shown === 'stop') { this.shown = null; this.d.hide() }this.d.autoStop(m)@@ -166,7 +166,7 @@ export class Watcher {}const over = byWindow || ended(now - r.lastMic, silentMs)if (over && this.shown !== 'stop' && now >= r.snoozeUntil) {- console.info(`CALL stop-card meeting=${m.id} app=${m.app ?? 'none'} reason=${byWindow ? 'window-gone-and-silent' : 'mic-idle-and-silent'} window_ms=${goneMs} idle_ms=${now - r.lastMic} silent_ms=${silentMs}`)+ console.info(`CALL stop-card meeting=${m.id} app=${m.app ?? 'none'} reason=${byWindow ? 'window-gone' : 'mic-idle-and-silent'} window_ms=${goneMs} idle_ms=${now - r.lastMic} silent_ms=${silentMs}`)this.shown = 'stop'; this.d.askStop(m)}else if (!over && this.shown === 'stop') { this.shown = null; this.d.hide() }diff --git a/app/test/detect.test.ts b/app/test/detect.test.tsindex c6d89e21..d8859525 100644--- a/app/test/detect.test.ts+++ b/app/test/detect.test.ts@@ -1,5 +1,5 @@import { describe, expect, it } from 'vitest'-import { callAppId, micPids, tabTitleApp, CALL_GONE_MS, callGone, watchEveryMs, decide, ended, isOwnMicApp, useCallApps, type Signals } from '../src/main/detect'+import { callAppId, micPids, tabTitleApp, CALL_GONE_MS, callGone, watchEveryMs, windowGone, decide, ended, isOwnMicApp, useCallApps, type Signals } from '../src/main/detect'import type { CalEvent } from '../src/main/calendar'const NOW = Date.parse('2026-10-29T15:00:00Z')@@ -108,6 +108,11 @@ describe('browser tab titles', () => {})})+it('requires eight seconds of continuous absence to count the call window as gone', () => {+ expect(windowGone(7_999)).toBe(false)+ expect(windowGone(8_000)).toBe(true)+})+describe('callGone', () => {const call = { app: 'Zoom', seen: true, micIdleMs: 0, silentMs: 60_000 }it('a call app that let go of the mic for the grace has ended; a blip has not', () => {diff --git a/app/test/watch.test.ts b/app/test/watch.test.tsindex 917bbcc4..c29b01c3 100644--- a/app/test/watch.test.ts+++ b/app/test/watch.test.ts@@ -517,19 +517,17 @@ describe('the call window going away ends the call', () => {it('a note started by hand stops by itself once Zoom\'s meeting window is gone, though Zoom keeps the mic', async () => {const info = vi.spyOn(console, 'info')await callStartedByHand()- // people leave, the meeting window closes; Zoom still holds the mic- for (let ms = 1_500; ms <= 30_000 && !log.length; ms += 1_500) { clock += 1_500; win = { goneMs: ms }; silent = ms; await w.tick() }+ clock += 8_000; win = { goneMs: 8_000 }; await w.tick()expect(log).toEqual(['auto:m1'])- const lines = info.mock.calls.map(([l]) => String(l))- expect(lines.find((l) => l.startsWith('CALL gone'))).toMatch(/^CALL gone meeting=m1 app=Zoom idle_ms=0 silent_ms=15000 via=window window_ms=15000 mic=us\.zoom\.xos$/)+ expect(info).toHaveBeenCalledWith('CALL gone meeting=m1 app=Zoom idle_ms=0 silent_ms=0 via=window window_ms=8000 mic=us.zoom.xos')info.mockRestore()})- it('logs what the mic said for the call app every 10 s after its window went away', async () => {+ it('keeps logging the mic every 10 s while the stop card is up', async () => {const info = vi.spyOn(console, 'info')+ auto = falseawait callStartedByHand()- // someone is still talking in the room: no end, but the log says what the mic didfor (let ms = 1_500; ms <= 30_000; ms += 1_500) { clock += 1_500; win = { goneMs: ms }; await w.tick() }- expect(log).toEqual([])+ expect(log).toEqual(['stop'])const lines = info.mock.calls.map(([l]) => String(l)).filter((l) => l.startsWith('CALL window-gone'))expect(lines).toEqual(['CALL window-gone meeting=m1 app=Zoom window_ms=1500 on_mic=true mic=us.zoom.xos silent_ms=0',@@ -538,16 +536,24 @@ describe('the call window going away ends the call', () => {])info.mockRestore()})- it('with "Stop recording when the call ends" off, it asks instead', async () => {+ it('asks at eight seconds if automatic stopping is off, even with sound in the room', async () => {+ const info = vi.spyOn(console, 'info')auto = falseawait callStartedByHand()- for (let ms = 1_500; ms <= 30_000; ms += 1_500) { clock += 1_500; win = { goneMs: ms }; silent = ms; await w.tick() }+ clock += 8_000; win = { goneMs: 8_000 }; await w.tick()expect(log).toEqual(['stop'])+ expect(info).toHaveBeenCalledWith('CALL stop-card meeting=m1 app=Zoom reason=window-gone window_ms=8000 idle_ms=0 silent_ms=0')+ info.mockRestore()})- it('never while people are still heard', async () => {- await callStartedByHand()- for (let ms = 1_500; ms <= 5 * MIN; ms += 1_500) { clock += 1_500; win = { goneMs: ms }; silent = 0; await w.tick() }- expect(log).toEqual([])+ it.each([0, 60_000])('stops by the window after Zoom releases the mic, with %i ms of silence', async silentMs => {+ const info = vi.spyOn(console, 'info')+ active = meeting(); reading.micApps = [zoom]; await w.tick()+ reading.micApps = []; silent = silentMs+ clock += 8_000; win = { goneMs: 8_000 }; await w.tick()+ await w.tick()+ expect(log).toEqual(['auto:m1'])+ expect(info).toHaveBeenCalledWith(`CALL gone meeting=m1 app=Zoom idle_ms=8000 silent_ms=${silentMs} via=window window_ms=8000 mic=none`)+ info.mockRestore()})it('never while the window is only hidden, minimised or on another desktop (the reader says it is not gone)', async () => {await callStartedByHand()