Skip to content

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.

Auto end: a recording stops about 4 to 5.5 s after the call app lets go of the mic (4 s grace, checked every 1.5 s while recording)

christianmat3bdf766eaae8
diff --git a/app/src/main/detect.ts b/app/src/main/detect.ts
index 15848b8c..eea6b679 100644
--- a/app/src/main/detect.ts
+++ b/app/src/main/detect.ts
@@ -131,8 +131,13 @@ export function ended(_s: Signals, micIdleMs: number, ctx?: { event: CalEvent |
return !!ctx?.event && ctx.now >= ctx.event.end + 5 * MIN && ctx.silentMs >= 60_000
}
-/** How long the call app must be off the mic before a recording stops by itself: reconnecting, a new headset or Zoom's own mute let go for a moment */
-export const CALL_GONE_MS = 10_000
+/**
+ * How long the call app must be off the mic before a recording stops by itself: a new headset or Zoom's own mute let go
+ * for a moment. Short, so hanging up ends the note within a few seconds; a call that drops for longer can be resumed.
+ */
+export const CALL_GONE_MS = 4_000
+/** how often the call signals are read: more often while recording, so the end of a call is seen quickly */
+export const watchEveryMs = (recording: boolean): number => (recording ? 1_500 : 3_000)
/**
* Should the recording stop by itself? Only one tied to a call app (app) that was on the mic during this recording (seen),
diff --git a/app/src/main/index.ts b/app/src/main/index.ts
index c89eaf63..42b5144e 100644
--- a/app/src/main/index.ts
+++ b/app/src/main/index.ts
@@ -21,7 +21,7 @@ import { pathToFileURL } from 'node:url'
import { isFake, userDataDir } from './paths'
import { logToFile } from './log'
import { loadSettings, localeOf, keepsRecording, recordingReminderOn, spokenSetting, stopsWhenCallEnds, updateSettings, visibilityOf, summaryLanguageSetting } from './settings'
-import { CALL_GONE_MS, useCallApps } from './detect'
+import { CALL_GONE_MS, useCallApps, watchEveryMs } from './detect'
import { systemLocale } from './locale'
import { language as uiLanguage, onLanguage, setLanguage, t } from '../shared/i18n'
import bundledCatalog from '../../../catalog/catalog.json'
@@ -419,9 +419,11 @@ function startDetection() {
refreshCalendarConsumers = () => { signals.invalidateCalendar(); void tray.refreshCalendar() }
setTrayVisible = tray.setVisible
trayShown = tray.shown
- // cheap, and only while Yogurt runs
- const timer = setInterval(() => void watcher.tick().catch((e) => console.error('detect failed', e)), 3000)
- app.on('will-quit', () => clearInterval(timer))
+ // cheap, and only while Yogurt runs; more often while recording, so a call that ended stops within a few seconds
+ let timer: NodeJS.Timeout | undefined
+ const watchLoop = () => { timer = setTimeout(() => { void watcher.tick().catch((e) => console.error('detect failed', e)).finally(watchLoop) }, watchEveryMs(!!activeMeeting())) }
+ watchLoop()
+ app.on('will-quit', () => clearTimeout(timer))
if (isFake()) {
installFakeHooks({
signals: async (r) => { signals.override(r); await watcher.tick() },
diff --git a/app/test/detect.test.ts b/app/test/detect.test.ts
index 3102be1d..ec25503f 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, tabTitleApp, CALL_GONE_MS, callGone, decide, ended, isOwnMicApp, useCallApps, type Signals } from '../src/main/detect'
+import { callAppId, tabTitleApp, CALL_GONE_MS, callGone, watchEveryMs, 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')
@@ -116,9 +116,13 @@ describe('browser tab titles', () => {
describe('callGone', () => {
const call = { app: 'Zoom', seen: true, micIdleMs: 0 }
it('a call app that let go of the mic for the grace has ended; a blip has not', () => {
- expect(CALL_GONE_MS).toBe(10_000)
- expect(callGone({ ...call, micIdleMs: 10_000 })).toBe(true)
- expect(callGone({ ...call, micIdleMs: 9_999 })).toBe(false)
+ expect(CALL_GONE_MS).toBe(4_000)
+ expect(callGone({ ...call, micIdleMs: 4_000 })).toBe(true)
+ expect(callGone({ ...call, micIdleMs: 3_999 })).toBe(false)
+ })
+ it('checks more often while recording, so a call that ended stops within about 4 to 5.5 s', () => {
+ expect(watchEveryMs(true)).toBe(1_500)
+ expect(watchEveryMs(false)).toBe(3_000)
})
it('the grace can be shorter (fake mode)', () => {
expect(callGone({ ...call, micIdleMs: 500, graceMs: 500 })).toBe(true)
diff --git a/app/test/watch.test.ts b/app/test/watch.test.ts
index 0a6cd48a..db96703c 100644
--- a/app/test/watch.test.ts
+++ b/app/test/watch.test.ts
@@ -178,10 +178,10 @@ describe('stop nudge', () => {
describe('stops by itself when the call ends', () => {
beforeEach(() => { active = meeting(); auto = true; w = autoWatcher() })
- it('the call app lets go of the mic for 10 s: stops once, with no question', async () => {
+ it('the call app lets go of the mic for 4 s: stops once, with no question', async () => {
reading = { micApps: [zoom], events: [] }; await w.tick()
reading = { micApps: [], events: [] }
- clock += 9_000; await w.tick()
+ clock += 3_000; await w.tick()
expect(log).toEqual([])
clock += 1_000; await w.tick(); await w.tick()
expect(log).toEqual(['auto:m1'])
@@ -196,9 +196,9 @@ describe('stops by itself when the call ends', () => {
})
it('a blip shorter than the grace does nothing', async () => {
reading = { micApps: [zoom], events: [] }; await w.tick()
- reading = { micApps: [], events: [] }; clock += 6_000; await w.tick()
- reading = { micApps: [zoom], events: [] }; clock += 3_000; await w.tick()
- reading = { micApps: [], events: [] }; clock += 6_000; await w.tick()
+ reading = { micApps: [], events: [] }; clock += 2_000; await w.tick()
+ reading = { micApps: [zoom], events: [] }; clock += 1_500; await w.tick()
+ reading = { micApps: [], events: [] }; clock += 3_000; await w.tick()
expect(log).toEqual([])
})
it('a Meet tab: the browser letting go of the mic ends it', async () => {
@@ -249,12 +249,12 @@ describe('binding a call after any recording start', () => {
await w.tick(); clock += 10_000
reading = { micApps: [mic], events: [], runningApps: [callAppId(mic.bundleId)!] }; await w.tick()
expect(active?.app).toBe(appName)
- reading = { micApps: [], events: [] }; clock += 9_999; await w.tick()
+ reading = { micApps: [], events: [] }; clock += 3_999; await w.tick()
expect(log).toEqual([])
clock++; await w.tick(); await w.tick()
expect(log).toEqual(['auto:m1'])
expect(info.mock.calls.map(([line]) => line)).toEqual([
- 'CALL watch meeting=m1 app=none', `CALL bind meeting=m1 app=${appName} via=mic`, `CALL gone meeting=m1 app=${appName} idle_ms=10000`,
+ 'CALL watch meeting=m1 app=none', `CALL bind meeting=m1 app=${appName} via=mic`, `CALL gone meeting=m1 app=${appName} idle_ms=4000`,
])
info.mockRestore()
})