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
Transcription on a slow processor no longer gives up mid-meeting: a slow whisper-server is not taken for a hung one, the graphics card is tried again at the next meeting and before the saved recording, a smaller model on disk takes over or live transcription pauses and says so, and audio that got no lines live is read again from the recording (#156)
christianmat48bcdfbe71e2
diff --git a/app/e2e/transcript.spec.ts b/app/e2e/transcript.spec.tsindex 072d4b72..2bb2ef87 100644--- a/app/e2e/transcript.spec.ts+++ b/app/e2e/transcript.spec.ts@@ -162,7 +162,7 @@ test('transcription trouble shows in the widget in plain words', async () => {const w = await windowOf(app, '#widget')await expect(w.getByTestId('widget-note')).toHaveText('Yogurt is falling behind. Some lines may be missing.')await fake(app, 'warn', 'transcribe-failed')- await expect(w.getByTestId('widget-note')).toHaveText("Some of this meeting couldn't be transcribed.")+ await expect(w.getByTestId('widget-note')).toHaveText('Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.')} finally { await app.close() }})diff --git a/app/src/main/asr/index.ts b/app/src/main/asr/index.tsindex f411743a..dad941ed 100644--- a/app/src/main/asr/index.ts+++ b/app/src/main/asr/index.ts@@ -10,6 +10,7 @@ import { loadAec3 } from './aec3'import { echoConfidence } from './echo'import { appleSpeechAvailable, installSpeechLocale, readSpeechLocales, speechDisagrees, speechFits, wantedSpeechLocale, type SpeechHost, type SpeechLocales } from './appleSpeech'import { whisperLanguage, type Spoken } from '../../shared/spoken'+import { basename } from 'node:path'import { createWhisperServer, recoverer, vadModelPath, whisperServerPath, type WhisperServer } from './server'import { clipStart, hearsClip } from './speedCheck'import { createTranscriber, type Line, type Transcribe } from './transcribe'@@ -100,7 +101,7 @@ export function spokenChanged() {for (const s of sessions.values()) if (s.speech && !speechFits(spoken, s.speech)) speechOff(s, 'English only was picked')}/** segments and hideSegments: the echo sweep after the meeting (tests may leave them out) */-type SessionStore = Pick<Store, 'updateMeeting'> & Partial<Pick<Store, 'segments' | 'hideSegments' | 'meeting'>>+type SessionStore = Pick<Store, 'updateMeeting'> & Partial<Pick<Store, 'segments' | 'hideSegments' | 'meeting' | 'deleteSegments'>>let server: WhisperServer | undefinedlet serverKey: string | undefined@@ -147,12 +148,12 @@ let gpuOffListener: (() => void) | undefinedexport function onWhisperGpuOff(cb: () => void) { gpuOffListener = cb }/** One whisper-server while meetings need it: started (warmed up) when one starts, let go a while after the last */-function serverFor(model: string, pidFile: string | undefined, make?: (model: string, pidFile?: string) => WhisperServer): WhisperServer {+function serverFor(model: string, pidFile: string | undefined, make?: (model: string, pidFile?: string) => WhisperServer, o: { cpuOnly?: boolean } = {}): WhisperServer {clearTimeout(idleTimer)const key = `${model}|${pidFile}`if (!server || serverKey !== key) {void server?.stop()- server = make ? make(model, pidFile) : createWhisperServer({ binary: whisperServerPath(), model, pidFile, vadModel: vadModelPath(), gpuFallback: process.platform !== 'darwin', onGpuOff: () => gpuOffListener?.(), checkGpu: async (url) => { const clip = clipStart(); return !clip || hearsClip(url, clip) } })+ server = make ? make(model, pidFile) : createWhisperServer({ binary: whisperServerPath(), model, pidFile, vadModel: vadModelPath(), gpuFallback: process.platform !== 'darwin', cpuOnly: o.cpuOnly, onGpuOff: () => gpuOffListener?.(), checkGpu: async (url) => { const clip = clipStart(); return !clip || hearsClip(url, clip) } })serverKey = key}return server@@ -174,9 +175,11 @@ function armServerIdle() {const NO_MODEL_NOTE_DELAY_MS = 400export function hookTranscription(p: {- store: Pick<Store, 'addSegments' | 'updateMeeting'> & Partial<Pick<Store, 'segments' | 'hideSegments' | 'meeting'>>+ store: Pick<Store, 'addSegments' | 'updateMeeting'> & Partial<Pick<Store, 'segments' | 'hideSegments' | 'meeting' | 'deleteSegments'>>/** the speech model, once setup has it */modelPath: () => string | undefined+ /** smaller speech models already on disk, best first: one takes over when the processor is too slow for the model (#156) */+ smallerModels?: () => string[]send: (seg: Omit<Segment, 'id'>) => void/** saved echoes changed during recording or the final sweep: the window reads them again */refresh?: (meetingId: string) => void@@ -241,11 +244,48 @@ export function hookTranscription(p: {else {const model = p.modelPath()if (model) {- const srv = serverFor(model, p.pidFile, p.server)+ let srv = serverFor(model, p.pidFile, p.server)srv.resetBudget()+ // no other meeting on it: a graphics card set aside earlier gets another chance (#156: it stayed off until a restart)+ if (!sessions.size) srv.gpuAgain(later ? 'a saved recording' : 'a new meeting')// the model takes a few seconds to load: start now, so the first chunk does not wait for itsrv.url().catch((e) => console.error('whisper-server did not start', e))- transcribe = createTranscriber({ url: () => srv.url(), recover: recoverer(srv), onLanguage: (_t, lang, chars, locked) => hear(lang, chars, locked), prompt: promptOf,+ const pauseLive = (why: string) => {+ if (s.pipeline?.paused()) return+ console.warn(`ASR ${why}: live transcription pauses, and the saved recording finishes the transcript after the meeting`)+ s.pipeline?.pause()+ warnOnce('live-paused')+ }+ const tried = new Set([model])+ let reading = model+ let judged: WhisperServer | undefined+ /**+ * On the processor and slower than the audio (#156): a smaller model already on disk takes over, or live+ * transcription pauses. A saved recording has no hurry: it just takes longer.+ */+ const tooSlow = () => {+ if (later || judged === srv || !srv.tooSlow) return+ judged = srv+ const why = `whisper-server on the processor reads ${basename(reading)} at ${srv.cpuRtf ? `${srv.cpuRtf.toFixed(2)} x` : 'more than'} the audio's length`+ const next = (p.smallerModels?.() ?? []).find((m) => !tried.has(m))+ // only when no other meeting shares the server+ if (next && [...sessions.values()].every((x) => x === s)) {+ tried.add(next); reading = next+ console.warn(`ASR ${why}: ${basename(next)} takes over for the rest of this meeting`)+ srv = serverFor(next, p.pidFile, p.server, { cpuOnly: true })+ srv.resetBudget()+ srv.url().catch((e) => console.error('whisper-server did not start', e))+ return+ }+ pauseLive(why)+ }+ // relaunches spent: nothing more goes to whisper this meeting+ const gaveUp = () => { if (!later) pauseLive('whisper-server will not be started again this meeting') }+ transcribe = createTranscriber({ url: () => srv.url(), recover: (reason, used) => recoverer(srv, { slow: tooSlow, gaveUp })(reason, used),+ // a saved recording has no hurry: on the processor a request may take 10 times its audio+ timeoutMs: (n) => (later && srv.cpuOnly ? Math.max(srv.timeoutMs(n), Math.round((n / 16) * 10)) : srv.timeoutMs(n)),+ onTimed: (n, ms, used) => { srv.timed(n, ms, used); tooSlow() },+ onLanguage: (_t, lang, chars, locked) => hear(lang, chars, locked), prompt: promptOf,language: () => options?.language ?? whisperLanguage(spokenNow()), signal: options?.signal })} else {console.warn('no speech model yet: this meeting is recorded but not transcribed')@@ -278,7 +318,7 @@ export function hookTranscription(p: {}}const s: Session = {- complete: () => !!transcribe && !pendingBefore && !saveFailed && !warned.has('transcribe-failed') && !s.failed && !options?.signal?.aborted,+ complete: () => !!transcribe && !pendingBefore && !saveFailed && !warned.has('transcribe-failed') && !s.failed && !options?.signal?.aborted && !s.pipeline?.paused() && !Object.keys(s.pipeline?.gaps() ?? {}).length,replacement: !!options?.save, liveEngine: !later && !!transcribe, store: p.store, refresh: p.refresh, speech: speechLocaleFor(id), priorLines: new Set(p.store.segments?.(id).map((s) => s.id) ?? []),pipeline: transcribe ? createPipeline({ meetingId: id, transcribe, save: (segs) => {try { if(options?.save) options.save(segs); else p.store.addSegments(segs) } catch (e) { saveFailed = true; throw e }@@ -403,11 +443,30 @@ function sweepEcho(id: string, s: Session) {} catch (e) { console.error('hiding echoes failed', e) }}+/**+ * A track with audio that got no lines live (a failed or dropped chunk, or paused): its lines from there on go, and the+ * saved recording reads the track again from that point (it starts where a track's lines end), so the transcript never+ * has a hole in it (#156).+ */+function clearAfterGaps(id: string, s: Session) {+ const gaps = s.pipeline?.gaps() ?? {}+ const store = s.store+ if (!store?.segments || !store.deleteSegments || !Object.keys(gaps).length) return+ try {+ const ids = store.segments(id, { hidden: true }).filter((l) => !s.priorLines.has(l.id) && l.startMs >= (gaps[l.track] ?? Infinity)).map((l) => l.id)+ if (!ids.length) return+ store.deleteSegments(ids)+ console.warn(`ASR ${ids.length} line(s) after audio that got none are read again from the saved recording`)+ s.refresh?.(id)+ } catch (e) { console.error('clearing lines after a gap failed', e) }+}+/** After the recorder is done (no more audio coming), the pipeline finishes what it has, then echoes are swept */function finishSession(id: string, s: Session, audioDone: () => Promise<void> = () => Promise.resolve(), store?: SessionStore): Promise<void> {s.store ??= storelet queued = falses.done ??= audioDone().then(() => s.pipeline?.finish()).then(() => {+ if (!s.replacement) clearAfterGaps(id, s)if (!s.replacement) sweepEcho(id, s)if (!s.replacement && s.complete?.()) s.store?.updateMeeting(id, { transcriptionPending: false })// whisper-server went down partway (#127): the audio is all in the saved recording, so the rest is transcribed fromdiff --git a/app/src/main/asr/pipeline.ts b/app/src/main/asr/pipeline.tsindex 40b543d8..af0642a9 100644--- a/app/src/main/asr/pipeline.ts+++ b/app/src/main/asr/pipeline.ts@@ -61,6 +61,14 @@ export function createPipeline(p: {let timer: NodeJS.Timeout | undefinedlet echoDropped = 0let closed = false+ /** live transcription stopped for the rest of the meeting (too slow, or whisper-server gone): the recording finishes it */+ let paused = false+ /**+ * Per track, the start of the first chunk that got no lines (failed, dropped or skipped while paused). The transcript+ * is not finished there: everything on the track from that point is read again from the saved recording (#156).+ */+ const gaps: Partial<Record<Track, number>> = {}+ const gap = (track: Track, startMs: number) => { gaps[track] = Math.min(gaps[track] ?? Infinity, startMs) }/** wall clock minus meeting time, from the newest audio: how long after it was said a line shows */let wallOffset = Date.now()const delays: Array<{ track: Track; partial: boolean; ms: number }> = []@@ -153,11 +161,12 @@ export function createPipeline(p: {p.transcribe(c).then((lines) => onLines(t, lines, c.startMs, chunkEnd))// its quick reading goes too: nothing final will replace it- .catch((e) => { console.error(`transcribing a ${t} chunk failed`, e); warn('transcribe-failed'); settle(t, chunkEnd) })+ .catch((e) => { console.error(`transcribing a ${t} chunk failed`, e); gap(t, c.startMs); warn('transcribe-failed'); settle(t, chunkEnd) }).finally(() => { running[t] = false; pump(t) })}const queue = (c: Chunk) => {+ if (paused) { gap(c.track, c.startMs); settle(c.track, c.startMs + c.samples.length / 16); return }const q = waiting[c.track]q.push(c)let size = q.reduce((n, x) => n + x.samples.length, 0)@@ -165,6 +174,7 @@ export function createPipeline(p: {const old = q.shift()!size -= old.samples.lengthdropped.push({ track: old.track, startMs: old.startMs, endMs: Math.round(old.startMs + old.samples.length / 16) })+ gap(old.track, old.startMs)settle(old.track, old.startMs + old.samples.length / 16)warn('falling-behind')}@@ -185,7 +195,7 @@ export function createPipeline(p: {*/const partial = (c: Chunk) => {const t = c.track- if (!quickReads[t] || !p.emitPartial || closed || running.me || running.them || waiting.me.length || waiting.them.length || lastPartialMs > SLOW_PARTIAL_MS) { if (lastPartialMs > SLOW_PARTIAL_MS) lastPartialMs = 0; return }+ if (!quickReads[t] || !p.emitPartial || closed || paused || running.me || running.them || waiting.me.length || waiting.them.length || lastPartialMs > SLOW_PARTIAL_MS) { if (lastPartialMs > SLOW_PARTIAL_MS) lastPartialMs = 0; return }const end = c.startMs + c.samples.length / 16if (end > lastPartialEnd[t] && end - lastPartialEnd[t] < PARTIAL_GAP_MS) returnlastPartialEnd[t] = end@@ -203,6 +213,25 @@ export function createPipeline(p: {let finishing: Promise<void> | undefinedreturn {+ /**+ * Live transcription stops for the rest of the meeting: what waits and what comes is left to the saved recording.+ * Requests already sent still give their lines.+ */+ pause() {+ if (paused || closed) return+ paused = true+ for (const t of ['me', 'them'] as const) {+ const first = waiting[t][0]+ if (first) gap(t, first.startMs)+ waiting[t] = []+ clearLive(t)+ }+ if (!queued('me') && !queued('them')) { const w = idle; idle = []; w.forEach((f) => f()) }+ },+ /** live transcription was paused */+ paused: () => paused,+ /** per track, where the first audio without lines starts (none: every chunk was read) */+ gaps: (): Partial<Record<Track, number>> => ({ ...gaps }),/** Reopening a transcript uses the same current words as its live updates. */partials: () => (['me', 'them'] as const).map(partOf),push(track: Track, ms: number, samples: Float32Array) {diff --git a/app/src/main/asr/server.ts b/app/src/main/asr/server.tsindex 94d5c981..945fb5f3 100644--- a/app/src/main/asr/server.ts+++ b/app/src/main/asr/server.ts@@ -5,6 +5,7 @@ import { createServer } from 'node:net'import { availableParallelism } from 'node:os'import { basename, dirname, join } from 'node:path'import { helperFile } from '../../shared/platform'+import { requestTimeoutMs } from './transcribe'/*** whisper-server (whisper.cpp, built by scripts/native.sh) on 127.0.0.1 with a random port.@@ -93,12 +94,22 @@ type Opts = {* Radeon RX 9070 XT) load whisper and answer every request with nothing; then it runs on the processor instead.*/checkGpu?: (url: string) => Promise<boolean>+ /** start on the processor (a smaller model taking over in a meeting that already set the graphics card aside) */+ cpuOnly?: boolean}/** a meeting relaunches a dead or hung server at most this often, waiting longer each time */export const RELAUNCH_BACKOFF_MS = [1000, 5000, 15_000]/** this long without trouble since the last relaunch, and the relaunches are all there again */export const HEALTHY_RESET_MS = 10 * 60_000+/**+ * On the processor, a model that takes longer than the audio it reads can't keep up with a meeting (#156: large-v3-turbo+ * took 1.7 times a clip's length on an i5-10400F). The time counts waiting behind the other track's request, which is+ * what keeping up means.+ */+export const LIVE_CPU_RTF = 1+/** finished requests on the processor it takes to judge its speed */+const CPU_SAMPLES = 2export function createWhisperServer(o: Opts) {let child: ChildProcess | null = null@@ -115,8 +126,21 @@ export function createWhisperServer(o: Opts) {let lastRelaunch = 0/** the program went away without being asked to */let died = false- /** a launch died before it answered, with gpuFallback: the graphics stay off from now on */- let cpuOnly = false+ /** with gpuFallback: the graphics card was set aside, until gpuAgain (the next meeting, or a saved recording) */+ let cpuOnly = o.cpuOnly ?? false+ /** why and when it was set aside, for the log when it is tried again */+ let offReason = ''+ /** time over audio length of the latest finished requests on the processor */+ let cpuRtfs: number[] = []+ /** requests on the processor that ran out of time while the server still answered */+ let slowOnCpu = 0+ const gpuOff = (why: string) => {+ cpuOnly = true+ offReason = `${why} (${new Date(now()).toISOString()})`+ cpuRtfs = []; slowOnCpu = 0+ console.error(`whisper-server ${why}; starting it again without the graphics card`)+ o.onGpuOff?.()+ }/** hangs on the graphics card (gpuFallback): the second one turns them off (#76) */let gpuHangs = 0/** a hang on the graphics card twice (#76: a GTX 1050 Ti under Vulkan never answered) turns them off for good */@@ -169,7 +193,7 @@ export function createWhisperServer(o: Opts) {let up: stringtry { up = await Promise.race([healthy, gone]) } catch (e) {healthy.catch(() => {})- if (o.gpuFallback && !cpuOnly && !ended.has(p) && (p.exitCode !== null || p.signalCode !== null)) { cpuOnly = true; console.error('whisper-server stopped while loading; starting it again without the graphics card'); o.onGpuOff?.() }+ if (o.gpuFallback && !cpuOnly && !ended.has(p) && (p.exitCode !== null || p.signalCode !== null)) gpuOff('stopped while loading')p.kill('SIGKILL')throw e}@@ -177,9 +201,7 @@ export function createWhisperServer(o: Opts) {let hears = truetry { hears = await o.checkGpu(up) } catch (e) { console.warn('whisper-server: checking the graphics card failed', e) }if (!hears) {- cpuOnly = true- console.error('whisper-server heard no words on the graphics card; starting it again without it')- o.onGpuOff?.()+ gpuOff('heard no words on the graphics card')if (child === p) { child = null; died = false }p.kill('SIGKILL')return launch()@@ -215,6 +237,37 @@ export function createWhisperServer(o: Opts) {},/** a new meeting: all relaunches again */resetBudget() { used = 0 },+ /**+ * The graphics card gets another chance (#156: once set aside it stayed off until Yogurt restarted, and the saved+ * recording was read on a processor too slow for the model). Asked with no meeting using the server, at the next+ * meeting and before a saved recording; within a meeting, a card that failed twice stays off. true: it will try.+ */+ gpuAgain(why: string): boolean {+ if (!o.gpuFallback || !cpuOnly || starting) return false+ console.info('ASR', `whisper-server tries the graphics card again for ${why}; it was set aside because it ${offReason || 'failed earlier'}`)+ cpuOnly = false; gpuHangs = 0; cpuRtfs = []; slowOnCpu = 0+ const p = child+ if (p) { ended.add(p); child = null; address = null; p.kill('SIGKILL') }+ died = false+ return true+ },+ /** how long a request with this many samples may take: on the processor, as long as its measured speed needs */+ timeoutMs(samples: number): number {+ const base = requestTimeoutMs(samples)+ if (!cpuOnly || !cpuRtfs.length) return base+ return Math.max(base, Math.round((samples / 16) * Math.max(...cpuRtfs) * 4))+ },+ /** a careful (final) request finished in ms: on the processor, that is its speed (not if it went to an older launch) */+ timed(samples: number, ms: number, at?: string) {+ if (!cpuOnly || samples <= 0 || (at !== undefined && at !== launchUrl)) return+ cpuRtfs = [...cpuRtfs, ms / (samples / 16)].slice(-5)+ },+ /** a request on the processor ran out of time while the server still answered: slow, not stuck */+ slow() { if (cpuOnly) slowOnCpu++ },+ /** the processor's speed with this model, time over audio length (null: not measured yet) */+ get cpuRtf(): number | null { return cpuOnly && cpuRtfs.length ? cpuRtfs.reduce((a, b) => a + b, 0) / cpuRtfs.length : null },+ /** on the processor and too slow to keep up with a meeting */+ get tooSlow(): boolean { return cpuOnly && (slowOnCpu > 0 || (cpuRtfs.length >= CPU_SAMPLES && (self.cpuRtf ?? 0) > LIVE_CPU_RTF)) },/*** It hangs or died: kill it and start another (the same relaunch as after a crash). `used` is the address the failed* request went to (`at`); if a newer launch exists or is starting, another request already did this, so just wait for that one.@@ -225,11 +278,9 @@ export function createWhisperServer(o: Opts) {if (p) { child = null; address = null; p.kill('SIGKILL') }died = trueif (o.gpuFallback && !cpuOnly && ++gpuHangs >= GPU_HANGS) {- cpuOnly = true// a new way of running: the meeting's relaunches start over for itused = 0- console.error('whisper-server hung twice on the graphics card; starting it again without it')- o.onGpuOff?.()+ gpuOff('hung twice on the graphics card')}return self.url()},@@ -259,14 +310,26 @@ export function createWhisperServer(o: Opts) {}export type WhisperServer = ReturnType<typeof createWhisperServer>-/** What the transcriber does when a request fails: a timeout means it hung, anything else is checked with a ping */-export const recoverer = (srv: WhisperServer) => async (reason: 'gone' | 'timeout', used?: string): Promise<boolean> => {+/**+ * What the transcriber does when a request fails. Anything but a timeout is checked with a ping. A timeout on the+ * graphics card means it hung (#76: the health check still answers then). On the processor, a server that still+ * answers is slow, not stuck (#156): relaunching it would only start the same slow work again and spend the meeting's+ * relaunches, so the request just fails (the saved recording fills it in) and `slow` is told.+ */+export const recoverer = (srv: WhisperServer, on: { slow?: () => void; gaveUp?: () => void } = {}) => async (reason: 'gone' | 'timeout', used?: string): Promise<boolean> => {try {if (reason === 'gone' && used && (await srv.alive(used))) return true+ if (reason === 'timeout' && srv.cpuOnly && used && (await srv.alive(used))) {+ console.warn(`whisper-server on the processor is slow, not stuck${srv.cpuRtf ? ` (${srv.cpuRtf.toFixed(2)} x the audio's length)` : ''}: not relaunched`)+ srv.slow()+ on.slow?.()+ return false+ }await srv.wedged(used)return true} catch (e) {console.error('whisper-server could not be brought back', e)+ on.gaveUp?.()return false}}diff --git a/app/src/main/asr/transcribe.ts b/app/src/main/asr/transcribe.tsindex de1d29e1..27e32bc6 100644--- a/app/src/main/asr/transcribe.ts+++ b/app/src/main/asr/transcribe.ts@@ -45,9 +45,11 @@ type Opts = {url: () => Promise<string>/** a request failed: bring the server back (true) or give up (false). Asked on each failed call; the server decides how often it agrees. */recover?: (reason: 'gone' | 'timeout', used?: string) => Promise<boolean>- /** how long one request may take before the server is taken to be hung (default: requestTimeoutMs) */signal?: AbortSignal- timeoutMs?: number+ /** how long one request may take before the server is taken to be hung (default: requestTimeoutMs), or how long for this many samples */+ timeoutMs?: number | ((samples: number) => number)+ /** a careful (not partial) request to the server at `used` finished, after ms: how fast it reads */+ onTimed?: (samples: number, ms: number, used?: string) => voidfetchFn?: typeof fetch/** the language a chunk was heard in, and how much was said in it (the notes are written in the main one) *//** locked: the track already had a language lock when this chunk was heard (one odd chunk before the lock should change nothing) */@@ -99,16 +101,21 @@ export function createTranscriber(o: Opts): Transcribe {if (!guess) form.set('no_language_probabilities', 'true')if (prompt) form.set('prompt', prompt)used = await o.url()- return fetchFn(`${used}/inference`, { method: 'POST', body: form, signal: o.signal ? AbortSignal.any([o.signal, AbortSignal.timeout(o.timeoutMs ?? requestTimeoutMs(c.samples.length))]) : AbortSignal.timeout(o.timeoutMs ?? requestTimeoutMs(c.samples.length)) })+ const ms = typeof o.timeoutMs === 'function' ? o.timeoutMs(c.samples.length) : o.timeoutMs ?? requestTimeoutMs(c.samples.length)+ return fetchFn(`${used}/inference`, { method: 'POST', body: form, signal: o.signal ? AbortSignal.any([o.signal, AbortSignal.timeout(ms)]) : AbortSignal.timeout(ms) })}- let res: Response- try { res = await send() } catch (err) {- // the server crashed or hung: one chance to bring it back, then the chunk is tried again- o.signal?.throwIfAborted()- const reason = err instanceof Error && err.name === 'TimeoutError' ? 'timeout' : 'gone'- if (!(await o.recover?.(reason, used).catch(() => false))) throw err- res = await send()+ let res: Response | undefined+ let t0 = 0+ // the server crashed or hung: it is brought back and the chunk tried again, twice at most (a graphics card that hangs+ // twice moves to the processor on the second, #76, and the chunk still gets read)+ for (let tries = 0; !res; tries++) {+ try { t0 = Date.now(); res = await send() } catch (err) {+ o.signal?.throwIfAborted()+ const reason = err instanceof Error && err.name === 'TimeoutError' ? 'timeout' : 'gone'+ if (tries >= 2 || !(await o.recover?.(reason, used).catch(() => false))) throw err+ }}+ if (res.ok && !partial) o.onTimed?.(c.samples.length, Date.now() - t0, used)if (!res.ok) throw new Error(`whisper-server answered ${res.status}`)const body = (await res.json()) as Verboseconst lines: Line[] = []diff --git a/app/src/main/capture.ts b/app/src/main/capture.tsindex c998ce70..397388b4 100644--- a/app/src/main/capture.ts+++ b/app/src/main/capture.ts@@ -23,7 +23,7 @@ export type Track = 'me' | 'them'*/export type WarnCode = 'no-system-audio' | 'device-changed' | 'no-mic' | 'mic-gone'/** Transcription trouble, shown like the recorder's hints: some audio could not be transcribed / no speech model yet / the queue overflowed */-export type TranscribeWarn = 'transcribe-failed' | 'no-speech-model' | 'falling-behind'+export type TranscribeWarn = 'transcribe-failed' | 'no-speech-model' | 'falling-behind' | 'live-paused'const WARN_CODES: readonly string[] = ['no-system-audio', 'device-changed', 'no-mic', 'mic-gone'] satisfies WarnCode[]/** The mic recording now, after each start or switch: uid null is Auto (the Mac's default input), name the device's */export type MicInUse = { uid: string | null; name: string | null }diff --git a/app/src/main/index.ts b/app/src/main/index.tsindex dcf5f614..46d74fd8 100644--- a/app/src/main/index.ts+++ b/app/src/main/index.ts@@ -661,7 +661,7 @@ app.whenReady().then(() => {if (process.platform === 'darwin' || process.platform === 'win32') callWindowOf = (id) => callNames.callWindow(id)// Windows and Linux: whisper left the graphics card in a meeting, so the speed check (timed with it) runs again next startonWhisperGpuOff(() => speedStore(speedFile()).forget())- hookTranscription({ store, modelPath: () => setup.installed()?.asr, send: (seg) => {+ hookTranscription({ store, modelPath: () => setup.installed()?.asr, smallerModels: () => setup.installed()?.smallerAsr ?? [], send: (seg) => {const order = seg.track === 'them' && seg.speaker ? store.speakerOrder(seg.meetingId, seg.speaker) : []const colored = { ...seg, speakerColor: speakerColor(seg.track, seg.speaker, order) }win?.webContents.send('transcript:segment', colored); sendWidgetTranscript('transcript:segment', colored)diff --git a/app/src/main/setup.ts b/app/src/main/setup.tsindex 4cf08b99..685c8900 100644--- a/app/src/main/setup.ts+++ b/app/src/main/setup.ts@@ -35,7 +35,7 @@ export type SetupDeps = {}/** Where the models ended up, for the parts of the app that use them; llm once the first notes model is in (after ready) */-export type Installed = { asr: string; llm?: string; recommendedLlm?: string; /** meaning search across meetings; word search works without it */ embed?: string }+export type Installed = { asr: string; /** smaller speech models already on disk, best first: one takes over when the processor is too slow for asr (#156) */ smallerAsr?: string[]; llm?: string; recommendedLlm?: string; /** meaning search across meetings; word search works without it */ embed?: string }/** the first notes model keeps being tried after ready: a minute, five, then every ten (a download picks up where it stopped) */const NOTES_RETRY_MS = [60_000, 5 * 60_000, 10 * 60_000]@@ -265,7 +265,10 @@ export class SetupController {asr = pickAsr(hw, catalog, { exclude: tried })}}- this.paths = { asr: asrPath }+ // never downloaded for this: only what is already there (a model the speed check or an earlier pick left)+ const picked = catalog.asr.findIndex((a) => join(dirs.asr, fileNameFor(a.url)) === asrPath)+ const smallerAsr = picked < 0 ? [] : catalog.asr.slice(picked + 1).map(asrItem).filter((i) => isVerified(i.dir, i.fileName, this.sha(i))).map((i) => join(i.dir, i.fileName))+ this.paths = { asr: asrPath, ...(smallerAsr.length ? { smallerAsr } : {}) }if (hasUpgrade) {this.paths.recommendedLlm = join(bigger!.dir, bigger!.fileName)if (isVerified(starterItem.dir, starterItem.fileName, this.sha(starterItem))) this.paths.llm = join(starterItem.dir, starterItem.fileName)diff --git a/app/src/main/widgetModel.ts b/app/src/main/widgetModel.tsindex 412deb2b..10d29f19 100644--- a/app/src/main/widgetModel.ts+++ b/app/src/main/widgetModel.ts@@ -39,7 +39,9 @@ export class WidgetModel {retitle(title: string): boolean { if (!this.m || this.m.title === title) return false; this.m = { ...this.m, title }; return true }warn(code: WarnCode | TranscribeWarn) {if (code === 'no-system-audio' || code === 'no-mic') this.missingAudio.add(code === 'no-mic' ? 'mic' : 'systemAudio')- else if (code === 'transcribe-failed' || code === 'no-speech-model' || code === 'falling-behind') this.textHint = code+ // a pause says the most: nothing more comes live, so a later hint never replaces it+ else if (code === 'live-paused') this.textHint = code+ else if ((code === 'transcribe-failed' || code === 'no-speech-model' || code === 'falling-behind') && this.textHint !== 'live-paused') this.textHint = code}/** the helper was restarted: it records again */hiccup(now: number) { this.hiccupUntil = now + HICCUP_MS }@@ -71,7 +73,8 @@ export class WidgetModel {else if (!muted && this.missingAudio.size === 2) note = { tone: 'hint', code: 'no-mic', missingAudio: ['mic', 'systemAudio'], text: this.mac ? t("Yogurt can't hear your microphone or the call. Turn on microphone and call audio in System Settings.") : this.noMic() }else if (!muted && this.missingAudio.has('mic')) note = { tone: 'hint', code: 'no-mic', text: this.mac ? t("Yogurt can't hear your mic. Allow it in System Settings.") : this.noMic() }else if (this.missingAudio.has('systemAudio')) note = { tone: 'hint', code: 'no-system-audio', text: this.mac ? t("Yogurt can't hear the call audio. Allow it in System Settings.") : t("Yogurt can't hear the call audio on this computer.") }- else if (this.textHint === 'transcribe-failed') note = { tone: 'hint', text: t("Some of this meeting couldn't be transcribed.") }+ else if (this.textHint === 'live-paused') note = { tone: 'hint', text: t('Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.') }+ else if (this.textHint === 'transcribe-failed') note = { tone: 'hint', text: t('Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.') }else if (this.textHint === 'no-speech-model') note = { tone: 'hint', text: t("The speech model isn't ready yet, so only audio is being saved.") }else if (this.textHint === 'falling-behind') note = { tone: 'hint', text: t('Yogurt is falling behind. Some lines may be missing.') }}diff --git a/app/src/shared/locales/ar.json b/app/src/shared/locales/ar.jsonindex 5cbfe6c1..ca35c60c 100644--- a/app/src/shared/locales/ar.json+++ b/app/src/shared/locales/ar.json@@ -388,7 +388,8 @@"Show in File Explorer": "إظهار في مستكشف الملفات","Show in Files": "إظهار في الملفات","Show or hide Ask Yogurt": "إظهار أو إخفاء اسأل Yogurt",- "Some of this meeting couldn't be transcribed.": "تعذّر نسخ جزء من هذا الاجتماع نصيًا.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "بعض السطور مفقودة حاليًا. سيكملها Yogurt من التسجيل بعد الاجتماع.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "توقّف النسخ المباشر مؤقتًا. سيُكمل Yogurt النص من التسجيل بعد الاجتماع.","Spoken language": "لغة الكلام","Star": "نجمة","Enter a valid start time.": "أدخل وقت بدء صالحًا.",diff --git a/app/src/shared/locales/bn.json b/app/src/shared/locales/bn.jsonindex f2791c0b..a7c1a396 100644--- a/app/src/shared/locales/bn.json+++ b/app/src/shared/locales/bn.json@@ -376,7 +376,8 @@"Show in File Explorer": "ফাইল এক্সপ্লোরারে দেখান","Show in Files": "Files-এ দেখান","Show or hide Ask Yogurt": "Ask Yogurt দেখান বা লুকান",- "Some of this meeting couldn't be transcribed.": "এই মিটিংয়ের কিছু অংশ ট্রান্সক্রাইব করা যায়নি।",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "কিছু লাইন আপাতত নেই। মিটিংয়ের পরে Yogurt রেকর্ডিং থেকে সেগুলো পূরণ করবে।",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "লাইভ ট্রান্সক্রিপশন থেমে আছে। মিটিংয়ের পরে Yogurt রেকর্ডিং থেকে ট্রান্সক্রিপ্ট শেষ করবে।","Spoken language": "কথ্য ভাষা","Star": "তারা","Enter a valid start time.": "একটি বৈধ শুরুর সময় লিখুন।",diff --git a/app/src/shared/locales/cs.json b/app/src/shared/locales/cs.jsonindex 39b3efe6..fd14ce8d 100644--- a/app/src/shared/locales/cs.json+++ b/app/src/shared/locales/cs.json@@ -382,7 +382,8 @@"Show in File Explorer": "Zobrazit v Průzkumníkovi souborů","Show in Files": "Zobrazit v Souborech","Show or hide Ask Yogurt": "Zobrazit nebo skrýt Zeptat se Yogurt",- "Some of this meeting couldn't be transcribed.": "Část této schůzky se nepodařilo přepsat.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Některé řádky zatím chybí. Yogurt je po schůzce doplní z nahrávky.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Živý přepis je pozastavený. Yogurt přepis po schůzce dokončí z nahrávky.","Spoken language": "Mluvený jazyk","Star": "Hvězda","Enter a valid start time.": "Zadejte platný čas začátku.",diff --git a/app/src/shared/locales/da.json b/app/src/shared/locales/da.jsonindex 19e44443..21a8e17a 100644--- a/app/src/shared/locales/da.json+++ b/app/src/shared/locales/da.json@@ -376,7 +376,8 @@"Show in File Explorer": "Vis i Stifinder","Show in Files": "Vis i Filer","Show or hide Ask Yogurt": "Vis eller skjul Spørg Yogurt",- "Some of this meeting couldn't be transcribed.": "En del af dette møde kunne ikke transskriberes.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Nogle linjer mangler indtil videre. Yogurt udfylder dem fra optagelsen efter mødet.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Live-transskriptionen er sat på pause. Yogurt gør transskriptionen færdig fra optagelsen efter mødet.","Spoken language": "Talesprog","Star": "Stjerne","Enter a valid start time.": "Angiv et gyldigt starttidspunkt.",diff --git a/app/src/shared/locales/de.json b/app/src/shared/locales/de.jsonindex e8f5f80b..56faf1b1 100644--- a/app/src/shared/locales/de.json+++ b/app/src/shared/locales/de.json@@ -376,7 +376,8 @@"Show in File Explorer": "Im Explorer zeigen","Show in Files": "In Dateien zeigen","Show or hide Ask Yogurt": "Yogurt fragen ein- oder ausblenden",- "Some of this meeting couldn't be transcribed.": "Ein Teil dieses Meetings ließ sich nicht transkribieren.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Einige Zeilen fehlen noch. Yogurt ergänzt sie nach dem Meeting aus der Aufnahme.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Die Live-Transkription ist pausiert. Yogurt stellt das Transkript nach dem Meeting aus der Aufnahme fertig.","Spoken language": "Gesprochene Sprache","Star": "Stern","Enter a valid start time.": "Gib eine gültige Startzeit ein.",diff --git a/app/src/shared/locales/el.json b/app/src/shared/locales/el.jsonindex b21ea859..7fa0a6e1 100644--- a/app/src/shared/locales/el.json+++ b/app/src/shared/locales/el.json@@ -376,7 +376,8 @@"Show in File Explorer": "Εμφάνιση στην Εξερεύνηση αρχείων","Show in Files": "Εμφάνιση στα Αρχεία","Show or hide Ask Yogurt": "Εμφάνιση ή απόκρυψη του Ρώτα το Yogurt",- "Some of this meeting couldn't be transcribed.": "Μέρος αυτής της σύσκεψης δεν απομαγνητοφωνήθηκε.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Λείπουν κάποιες γραμμές προς το παρόν. Το Yogurt θα τις συμπληρώσει από την ηχογράφηση μετά τη σύσκεψη.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Η ζωντανή απομαγνητοφώνηση σταμάτησε προσωρινά. Το Yogurt θα ολοκληρώσει την απομαγνητοφώνηση από την ηχογράφηση μετά τη σύσκεψη.","Spoken language": "Ομιλούμενη γλώσσα","Star": "Αστέρι","Enter a valid start time.": "Εισαγάγετε μια έγκυρη ώρα έναρξης.",diff --git a/app/src/shared/locales/es.json b/app/src/shared/locales/es.jsonindex f82c9aa0..5d854bbb 100644--- a/app/src/shared/locales/es.json+++ b/app/src/shared/locales/es.json@@ -379,7 +379,8 @@"Show in File Explorer": "Mostrar en el Explorador de archivos","Show in Files": "Mostrar en Archivos","Show or hide Ask Yogurt": "Mostrar u ocultar Preguntar a Yogurt",- "Some of this meeting couldn't be transcribed.": "Una parte de esta reunión no se pudo transcribir.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Faltan algunas líneas por ahora. Yogurt las completará con la grabación después de la reunión.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "La transcripción en directo está en pausa. Yogurt terminará la transcripción con la grabación después de la reunión.","Spoken language": "Idioma hablado","Star": "Estrella","Enter a valid start time.": "Introduce una hora de inicio válida.",diff --git a/app/src/shared/locales/fi.json b/app/src/shared/locales/fi.jsonindex e462dcb3..94d9e55f 100644--- a/app/src/shared/locales/fi.json+++ b/app/src/shared/locales/fi.json@@ -376,7 +376,8 @@"Show in File Explorer": "Näytä Resurssienhallinnassa","Show in Files": "Näytä Tiedostoissa","Show or hide Ask Yogurt": "Näytä tai piilota Kysy Yogurtilta",- "Some of this meeting couldn't be transcribed.": "Osaa tästä kokouksesta ei voitu litteroida.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Joitakin rivejä puuttuu vielä. Yogurt täydentää ne tallenteesta kokouksen jälkeen.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Reaaliaikainen litterointi on tauolla. Yogurt viimeistelee litteroinnin tallenteesta kokouksen jälkeen.","Spoken language": "Puhuttu kieli","Star": "Tähti","Enter a valid start time.": "Anna kelvollinen aloitusaika.",diff --git a/app/src/shared/locales/fil.json b/app/src/shared/locales/fil.jsonindex 14c130e4..68b4ab6d 100644--- a/app/src/shared/locales/fil.json+++ b/app/src/shared/locales/fil.json@@ -376,7 +376,8 @@"Show in File Explorer": "Ipakita sa File Explorer","Show in Files": "Ipakita sa Files","Show or hide Ask Yogurt": "Ipakita o itago ang Magtanong sa Yogurt",- "Some of this meeting couldn't be transcribed.": "Hindi na-transcribe ang bahagi ng meeting na ito.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "May ilang linyang kulang sa ngayon. Pupunan ito ng Yogurt mula sa recording pagkatapos ng meeting.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Naka-pause ang live na transcription. Tatapusin ng Yogurt ang transcript mula sa recording pagkatapos ng meeting.","Spoken language": "Wikang sinasalita","Star": "Bituin","Enter a valid start time.": "Maglagay ng wastong oras ng pagsisimula.",diff --git a/app/src/shared/locales/fr.json b/app/src/shared/locales/fr.jsonindex 6a408199..a5554d8d 100644--- a/app/src/shared/locales/fr.json+++ b/app/src/shared/locales/fr.json@@ -379,7 +379,8 @@"Show in File Explorer": "Afficher dans l’Explorateur de fichiers","Show in Files": "Afficher dans Fichiers","Show or hide Ask Yogurt": "Afficher ou masquer Demander à Yogurt",- "Some of this meeting couldn't be transcribed.": "Une partie de cette réunion n’a pas pu être transcrite.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Il manque quelques lignes pour l’instant. Yogurt les complétera à partir de l’enregistrement après la réunion.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "La transcription en direct est en pause. Yogurt terminera la transcription à partir de l’enregistrement après la réunion.","Spoken language": "Langue parlée","Star": "Étoile","Enter a valid start time.": "Saisissez une heure de début valide.",diff --git a/app/src/shared/locales/he.json b/app/src/shared/locales/he.jsonindex 1106589c..71cae2df 100644--- a/app/src/shared/locales/he.json+++ b/app/src/shared/locales/he.json@@ -379,7 +379,8 @@"Show in File Explorer": "הצגה בסייר הקבצים","Show in Files": "הצגה בקבצים","Show or hide Ask Yogurt": "הצגה או הסתרה של שאל את Yogurt",- "Some of this meeting couldn't be transcribed.": "לא ניתן היה לתמלל חלק מהפגישה הזו.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "חסרות כרגע כמה שורות. Yogurt ישלים אותן מההקלטה אחרי הפגישה.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "התמלול החי מושהה. Yogurt ישלים את התמלול מההקלטה אחרי הפגישה.","Spoken language": "שפת הדיבור","Star": "כוכב","Enter a valid start time.": "יש להזין שעת התחלה תקינה.",diff --git a/app/src/shared/locales/hi.json b/app/src/shared/locales/hi.jsonindex 928c723c..b5d04505 100644--- a/app/src/shared/locales/hi.json+++ b/app/src/shared/locales/hi.json@@ -376,7 +376,8 @@"Show in File Explorer": "फ़ाइल एक्सप्लोरर में दिखाएँ","Show in Files": "Files में दिखाएँ","Show or hide Ask Yogurt": "Yogurt से पूछें दिखाएँ या छिपाएँ",- "Some of this meeting couldn't be transcribed.": "इस मीटिंग का कुछ हिस्सा ट्रांसक्राइब नहीं हो सका।",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "अभी कुछ लाइनें छूटी हैं। मीटिंग के बाद Yogurt उन्हें रिकॉर्डिंग से भर देगा।",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "लाइव ट्रांसक्रिप्शन रुका हुआ है। मीटिंग के बाद Yogurt रिकॉर्डिंग से ट्रांसक्रिप्ट पूरा करेगा।","Spoken language": "बोली जाने वाली भाषा","Star": "तारा","Enter a valid start time.": "शुरू होने का मान्य समय दर्ज करें।",diff --git a/app/src/shared/locales/hu.json b/app/src/shared/locales/hu.jsonindex 3fb3cf78..f2768ed0 100644--- a/app/src/shared/locales/hu.json+++ b/app/src/shared/locales/hu.json@@ -376,7 +376,8 @@"Show in File Explorer": "Megjelenítés a Fájlkezelőben","Show in Files": "Megjelenítés a Fájlokban","Show or hide Ask Yogurt": "Kérdezze a Yogurtot megjelenítése vagy elrejtése",- "Some of this meeting couldn't be transcribed.": "A megbeszélés egy részét nem sikerült átírni.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Néhány sor egyelőre hiányzik. A Yogurt a megbeszélés után kiegészíti őket a felvételből.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Az élő átírás szünetel. A Yogurt a megbeszélés után a felvételből fejezi be az átiratot.","Spoken language": "Beszélt nyelv","Star": "Csillag","Enter a valid start time.": "Adj meg érvényes kezdési időt.",diff --git a/app/src/shared/locales/id.json b/app/src/shared/locales/id.jsonindex 359c3e4d..85ec0663 100644--- a/app/src/shared/locales/id.json+++ b/app/src/shared/locales/id.json@@ -367,7 +367,8 @@"Show in File Explorer": "Tampilkan di File Explorer","Show in Files": "Tampilkan di Berkas","Show or hide Ask Yogurt": "Tampilkan atau sembunyikan Tanya Yogurt",- "Some of this meeting couldn't be transcribed.": "Sebagian rapat ini tidak bisa ditranskripsi.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Beberapa baris belum ada untuk saat ini. Yogurt akan melengkapinya dari rekaman setelah rapat.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Transkripsi langsung dijeda. Yogurt akan menyelesaikan transkrip dari rekaman setelah rapat.","Spoken language": "Bahasa lisan","Star": "Bintang","Enter a valid start time.": "Masukkan waktu mulai yang valid.",diff --git a/app/src/shared/locales/it.json b/app/src/shared/locales/it.jsonindex 5dcbc65a..d870d14e 100644--- a/app/src/shared/locales/it.json+++ b/app/src/shared/locales/it.json@@ -379,7 +379,8 @@"Show in File Explorer": "Mostra in Esplora file","Show in Files": "Mostra in File","Show or hide Ask Yogurt": "Mostra o nascondi Chiedi a Yogurt",- "Some of this meeting couldn't be transcribed.": "Una parte di questa riunione non è stata trascritta.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Per ora mancano alcune righe. Yogurt le completerà dalla registrazione dopo la riunione.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "La trascrizione dal vivo è in pausa. Yogurt completerà la trascrizione dalla registrazione dopo la riunione.","Spoken language": "Lingua parlata","Star": "Stella","Enter a valid start time.": "Inserisci un orario di inizio valido.",diff --git a/app/src/shared/locales/ja.json b/app/src/shared/locales/ja.jsonindex 9d034e86..e2c8c69b 100644--- a/app/src/shared/locales/ja.json+++ b/app/src/shared/locales/ja.json@@ -367,7 +367,8 @@"Show in File Explorer": "エクスプローラーで表示","Show in Files": "ファイルで表示","Show or hide Ask Yogurt": "Yogurtに質問を表示/非表示",- "Some of this meeting couldn't be transcribed.": "このミーティングの一部を文字起こしできませんでした。",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "いまは一部の行が抜けています。ミーティングのあとで Yogurt が録音から補います。",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "リアルタイムの文字起こしを一時停止しました。ミーティングのあとで Yogurt が録音から文字起こしを仕上げます。","Spoken language": "話す言語","Star": "星","Enter a valid start time.": "有効な開始時刻を入力してください。",diff --git a/app/src/shared/locales/ko.json b/app/src/shared/locales/ko.jsonindex 3bee3ae0..bfcdda94 100644--- a/app/src/shared/locales/ko.json+++ b/app/src/shared/locales/ko.json@@ -367,7 +367,8 @@"Show in File Explorer": "파일 탐색기에서 보기","Show in Files": "파일에서 보기","Show or hide Ask Yogurt": "Yogurt에 질문 표시 또는 숨기기",- "Some of this meeting couldn't be transcribed.": "이 회의의 일부는 녹취하지 못했어요.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "지금은 일부 줄이 빠져 있어요. 회의가 끝나면 Yogurt가 녹음에서 채워 넣을게요.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "실시간 녹취를 일시 중지했어요. 회의가 끝나면 Yogurt가 녹음으로 녹취록을 마무리할게요.","Spoken language": "말하는 언어","Star": "별","Enter a valid start time.": "올바른 시작 시간을 입력하세요.",diff --git a/app/src/shared/locales/ms.json b/app/src/shared/locales/ms.jsonindex acedcce5..586a0298 100644--- a/app/src/shared/locales/ms.json+++ b/app/src/shared/locales/ms.json@@ -367,7 +367,8 @@"Show in File Explorer": "Tunjukkan dalam File Explorer","Show in Files": "Tunjukkan dalam Fail","Show or hide Ask Yogurt": "Tunjukkan atau sembunyikan Tanya Yogurt",- "Some of this meeting couldn't be transcribed.": "Sebahagian mesyuarat ini tidak dapat ditranskripsikan.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Beberapa baris tiada buat masa ini. Yogurt akan mengisinya daripada rakaman selepas mesyuarat.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Transkripsi langsung dijeda. Yogurt akan menyiapkan transkrip daripada rakaman selepas mesyuarat.","Spoken language": "Bahasa pertuturan","Star": "Bintang","Enter a valid start time.": "Masukkan masa mula yang sah.",diff --git a/app/src/shared/locales/nb.json b/app/src/shared/locales/nb.jsonindex 716f89b4..e3ab1e9d 100644--- a/app/src/shared/locales/nb.json+++ b/app/src/shared/locales/nb.json@@ -376,7 +376,8 @@"Show in File Explorer": "Vis i Filutforsker","Show in Files": "Vis i Filer","Show or hide Ask Yogurt": "Vis eller skjul Spør Yogurt",- "Some of this meeting couldn't be transcribed.": "Noe av dette møtet kunne ikke transkriberes.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Noen linjer mangler foreløpig. Yogurt fyller dem inn fra opptaket etter møtet.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Direkte transkribering er satt på pause. Yogurt fullfører transkripsjonen fra opptaket etter møtet.","Spoken language": "Talespråk","Star": "Stjerne","Enter a valid start time.": "Angi et gyldig starttidspunkt.",diff --git a/app/src/shared/locales/nl.json b/app/src/shared/locales/nl.jsonindex 7b0447cc..fea6fefc 100644--- a/app/src/shared/locales/nl.json+++ b/app/src/shared/locales/nl.json@@ -376,7 +376,8 @@"Show in File Explorer": "Toon in Verkenner","Show in Files": "Toon in Bestanden","Show or hide Ask Yogurt": "Vraag Yogurt tonen of verbergen",- "Some of this meeting couldn't be transcribed.": "Een deel van deze meeting kon niet worden getranscribeerd.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Er ontbreken nu nog een paar regels. Yogurt vult ze na de meeting aan uit de opname.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Live transcriptie is gepauzeerd. Yogurt maakt het transcript na de meeting af uit de opname.","Spoken language": "Gesproken taal","Star": "Ster","Enter a valid start time.": "Voer een geldige begintijd in.",diff --git a/app/src/shared/locales/pl.json b/app/src/shared/locales/pl.jsonindex 252e95f3..ad33c7a1 100644--- a/app/src/shared/locales/pl.json+++ b/app/src/shared/locales/pl.json@@ -382,7 +382,8 @@"Show in File Explorer": "Pokaż w Eksploratorze plików","Show in Files": "Pokaż w Plikach","Show or hide Ask Yogurt": "Pokaż lub ukryj Zapytaj Yogurt",- "Some of this meeting couldn't be transcribed.": "Części tego spotkania nie udało się przepisać.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Na razie brakuje kilku wierszy. Yogurt uzupełni je z nagrania po spotkaniu.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Transkrypcja na żywo jest wstrzymana. Yogurt dokończy transkrypcję z nagrania po spotkaniu.","Spoken language": "Język rozmowy","Star": "Gwiazda","Enter a valid start time.": "Wpisz prawidłową godzinę rozpoczęcia.",diff --git a/app/src/shared/locales/pt-BR.json b/app/src/shared/locales/pt-BR.jsonindex ccfbedf3..fc2badf4 100644--- a/app/src/shared/locales/pt-BR.json+++ b/app/src/shared/locales/pt-BR.json@@ -379,7 +379,8 @@"Show in File Explorer": "Mostrar no Explorador de Arquivos","Show in Files": "Mostrar em Arquivos","Show or hide Ask Yogurt": "Mostrar ou ocultar Perguntar ao Yogurt",- "Some of this meeting couldn't be transcribed.": "Parte desta reunião não pôde ser transcrita.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Algumas linhas estão faltando por enquanto. O Yogurt vai completá-las com a gravação depois da reunião.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "A transcrição ao vivo está pausada. O Yogurt vai terminar a transcrição com a gravação depois da reunião.","Spoken language": "Idioma falado","Star": "Estrela","Enter a valid start time.": "Insira um horário de início válido.",diff --git a/app/src/shared/locales/ro.json b/app/src/shared/locales/ro.jsonindex f5a73e86..af551942 100644--- a/app/src/shared/locales/ro.json+++ b/app/src/shared/locales/ro.json@@ -379,7 +379,8 @@"Show in File Explorer": "Afișați în Explorer","Show in Files": "Afișați în Fișiere","Show or hide Ask Yogurt": "Arată sau ascunde Întreabă Yogurt",- "Some of this meeting couldn't be transcribed.": "O parte din această întâlnire nu a putut fi transcrisă.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Deocamdată lipsesc câteva rânduri. Yogurt le va completa din înregistrare după întâlnire.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Transcrierea live este pe pauză. Yogurt va termina transcrierea din înregistrare după întâlnire.","Spoken language": "Limba vorbită","Star": "Stea","Enter a valid start time.": "Introdu o oră de începere validă.",diff --git a/app/src/shared/locales/ru.json b/app/src/shared/locales/ru.jsonindex c0a666b4..212aa269 100644--- a/app/src/shared/locales/ru.json+++ b/app/src/shared/locales/ru.json@@ -382,7 +382,8 @@"Show in File Explorer": "Показать в Проводнике","Show in Files": "Показать в Файлах","Show or hide Ask Yogurt": "Показать или скрыть «Спросить Yogurt»",- "Some of this meeting couldn't be transcribed.": "Часть этой встречи не удалось расшифровать.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Пока не хватает нескольких строк. Yogurt дополнит их из записи после встречи.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Расшифровка в реальном времени приостановлена. Yogurt закончит расшифровку по записи после встречи.","Spoken language": "Язык речи","Star": "Звезда","Enter a valid start time.": "Введите допустимое время начала.",diff --git a/app/src/shared/locales/sv.json b/app/src/shared/locales/sv.jsonindex 2104c2e2..9f3930dd 100644--- a/app/src/shared/locales/sv.json+++ b/app/src/shared/locales/sv.json@@ -376,7 +376,8 @@"Show in File Explorer": "Visa i Utforskaren","Show in Files": "Visa i Filer","Show or hide Ask Yogurt": "Visa eller dölj Fråga Yogurt",- "Some of this meeting couldn't be transcribed.": "En del av mötet kunde inte transkriberas.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Några rader saknas just nu. Yogurt fyller i dem från inspelningen efter mötet.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Livetranskriberingen är pausad. Yogurt gör klart transkriptionen från inspelningen efter mötet.","Spoken language": "Talat språk","Star": "Stjärna","Enter a valid start time.": "Ange en giltig starttid.",diff --git a/app/src/shared/locales/th.json b/app/src/shared/locales/th.jsonindex 2f58c38c..fb607d54 100644--- a/app/src/shared/locales/th.json+++ b/app/src/shared/locales/th.json@@ -367,7 +367,8 @@"Show in File Explorer": "แสดงใน File Explorer","Show in Files": "แสดงใน Files","Show or hide Ask Yogurt": "แสดงหรือซ่อนถาม Yogurt",- "Some of this meeting couldn't be transcribed.": "ถอดความการประชุมนี้ไม่ได้บางส่วน",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "ตอนนี้ยังขาดบางบรรทัด Yogurt จะเติมให้จากไฟล์บันทึกเสียงหลังการประชุม",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "หยุดถอดความสดไว้ชั่วคราว Yogurt จะถอดความต่อให้เสร็จจากไฟล์บันทึกเสียงหลังการประชุม","Spoken language": "ภาษาที่พูด","Star": "ดาว","Enter a valid start time.": "ป้อนเวลาเริ่มต้นที่ถูกต้อง",diff --git a/app/src/shared/locales/tr.json b/app/src/shared/locales/tr.jsonindex af75f659..3afc5944 100644--- a/app/src/shared/locales/tr.json+++ b/app/src/shared/locales/tr.json@@ -376,7 +376,8 @@"Show in File Explorer": "Dosya Gezgini’nde göster","Show in Files": "Dosyalar’da göster","Show or hide Ask Yogurt": "Yogurt’a Sor’u göster veya gizle",- "Some of this meeting couldn't be transcribed.": "Bu toplantının bir kısmı transkripte dönüştürülemedi.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Şimdilik bazı satırlar eksik. Yogurt toplantıdan sonra bunları kayıttan tamamlayacak.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Canlı transkripsiyon duraklatıldı. Yogurt toplantıdan sonra transkripti kayıttan tamamlayacak.","Spoken language": "Konuşulan dil","Star": "Yıldız","Enter a valid start time.": "Geçerli bir başlangıç saati girin.",diff --git a/app/src/shared/locales/uk.json b/app/src/shared/locales/uk.jsonindex 82f0a9c8..886fce66 100644--- a/app/src/shared/locales/uk.json+++ b/app/src/shared/locales/uk.json@@ -382,7 +382,8 @@"Show in File Explorer": "Показати у Провіднику","Show in Files": "Показати у Файлах","Show or hide Ask Yogurt": "Показати або приховати «Запитати Yogurt»",- "Some of this meeting couldn't be transcribed.": "Частину цієї зустрічі не вдалося розшифрувати.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Поки бракує кількох рядків. Yogurt доповнить їх із запису після зустрічі.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Розшифрування наживо призупинено. Yogurt завершить розшифровку із запису після зустрічі.","Spoken language": "Мова розмови","Star": "Зірка","Enter a valid start time.": "Введіть коректний час початку.",diff --git a/app/src/shared/locales/vi.json b/app/src/shared/locales/vi.jsonindex 9dce6841..6b06fcc8 100644--- a/app/src/shared/locales/vi.json+++ b/app/src/shared/locales/vi.json@@ -367,7 +367,8 @@"Show in File Explorer": "Hiển thị trong File Explorer","Show in Files": "Hiển thị trong Tập tin","Show or hide Ask Yogurt": "Hiện hoặc ẩn Hỏi Yogurt",- "Some of this meeting couldn't be transcribed.": "Không chép lời được một phần cuộc họp này.",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "Hiện còn thiếu một vài dòng. Yogurt sẽ bổ sung từ bản ghi âm sau cuộc họp.",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "Đã tạm dừng chép lời trực tiếp. Yogurt sẽ hoàn tất bản chép lời từ bản ghi âm sau cuộc họp.","Spoken language": "Ngôn ngữ nói","Star": "Ngôi sao","Enter a valid start time.": "Nhập giờ bắt đầu hợp lệ.",diff --git a/app/src/shared/locales/zh-CN.json b/app/src/shared/locales/zh-CN.jsonindex ac78288f..f8f3be27 100644--- a/app/src/shared/locales/zh-CN.json+++ b/app/src/shared/locales/zh-CN.json@@ -367,7 +367,8 @@"Show in File Explorer": "在文件资源管理器中显示","Show in Files": "在“文件”中显示","Show or hide Ask Yogurt": "显示或隐藏询问 Yogurt",- "Some of this meeting couldn't be transcribed.": "这个会议有一部分无法转写。",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "暂时缺了一些内容。会议结束后,Yogurt 会根据录音补上。",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "实时转写已暂停。会议结束后,Yogurt 会根据录音完成转写。","Spoken language": "会议语言","Star": "星形","Enter a valid start time.": "请输入有效的开始时间。",diff --git a/app/src/shared/locales/zh-TW.json b/app/src/shared/locales/zh-TW.jsonindex 0c624cde..ba310719 100644--- a/app/src/shared/locales/zh-TW.json+++ b/app/src/shared/locales/zh-TW.json@@ -367,7 +367,8 @@"Show in File Explorer": "在檔案總管中顯示","Show in Files": "在「檔案」中顯示","Show or hide Ask Yogurt": "顯示或隱藏詢問 Yogurt",- "Some of this meeting couldn't be transcribed.": "這場會議有一部分無法轉寫。",+ "Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.": "目前缺了一些內容。會議結束後,Yogurt 會根據錄音補上。",+ "Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.": "即時轉寫已暫停。會議結束後,Yogurt 會根據錄音完成轉寫。","Spoken language": "會議語言","Star": "星形","Enter a valid start time.": "請輸入有效的開始時間。",diff --git a/app/test/asrServer.test.ts b/app/test/asrServer.test.tsindex d190a085..7e1622e9 100644--- a/app/test/asrServer.test.ts+++ b/app/test/asrServer.test.ts@@ -7,7 +7,8 @@ import { createTranscriber } from '../src/main/asr/transcribe'/*** a stand-in for the whisper-server program: answers GET / on --host/--port once it has "loaded".- * modes: what each launch does with a request to /inference (the last one repeats): ok, crash (exits), wedge (never answers).+ * modes: what each launch does with a request to /inference (the last one repeats): ok, crash (exits), wedge (never answers),+ * slow (answers after 800 ms).*/function fakeBinary(loadMs = 0, modes: string[] = ['ok']) {const dir = mkdtempSync(join(tmpdir(), 'yogurt-ws-'))@@ -27,7 +28,8 @@ function fakeBinary(loadMs = 0, modes: string[] = ['ok']) {q.resume()if (mode === 'crash') process.exit(1)if (mode === 'wedge') return- q.on('end', () => r.end(JSON.stringify({ detected_language: 'english', detected_language_probability: 0.99, segments: [{ start: 0, end: 1, text: ' Fine words here today' }] })))+ const ans = () => r.end(JSON.stringify({ detected_language: 'english', detected_language_probability: 0.99, segments: [{ start: 0, end: 1, text: ' Fine words here today' }] }))+ q.on('end', () => (mode === 'slow' ? setTimeout(ans, 800) : ans()))}).listen(port, host), ${loadMs})`)const bin = join(dir, 'whisper-server')@@ -299,6 +301,103 @@ describe.skipIf(process.platform === 'win32')('restart budget', () => {})})+// #156: large-v3-turbo on an i5-10400F took 1.7 times the audio; every timeout spent a relaunch until transcription stopped+describe.skipIf(process.platform === 'win32')('slow on the processor', () => {+ it('a request on the processor that runs out of time while the server answers is slow, not stuck: no relaunch', async () => {+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})+ const srv = make(fakeBinary(0, ['slow']), { gpuFallback: true, cpuOnly: true })+ const slow = vi.fn()+ const tr = createTranscriber({ url: () => srv.url(), recover: recoverer(srv, { slow }), timeoutMs: 300 })+ for (let i = 0; i < 4; i++) await expect(tr(chunk)).rejects.toThrow()+ expect(srv.launches).toBe(1)+ expect(slow).toHaveBeenCalledTimes(4)+ expect(srv.tooSlow).toBe(true)+ // it still answers, and a request with time enough goes through+ expect((await createTranscriber({ url: () => srv.url(), timeoutMs: 5000 })(chunk)).length).toBe(1)+ warn.mockRestore()+ })++ it('on the graphics card a timeout is still a hang', async () => {+ const srv = make(fakeBinary(0, ['slow', 'ok']), { gpuFallback: true })+ const slow = vi.fn()+ const tr = createTranscriber({ url: () => srv.url(), recover: recoverer(srv, { slow }), timeoutMs: 300 })+ expect((await tr(chunk)).length).toBe(1)+ expect(srv.launches).toBe(2)+ expect(slow).not.toHaveBeenCalled()+ })++ it('the relaunches spent, the transcriber is told it gave up', async () => {+ const errors = vi.spyOn(console, 'error').mockImplementation(() => {})+ const srv = make(fakeBinary(0, ['crash']))+ const gaveUp = vi.fn()+ const tr = createTranscriber({ url: () => srv.url(), recover: recoverer(srv, { gaveUp }) })+ for (let i = 0; i < 6; i++) await expect(tr(chunk)).rejects.toThrow()+ expect(gaveUp).toHaveBeenCalled()+ errors.mockRestore()+ })+})++describe('speed on the processor', () => {+ const srv = (cpuOnly: boolean) => createWhisperServer({ binary: '/none', model: '/m.bin', gpuFallback: true, cpuOnly })+ it('the timeout follows the measured speed on the processor, and stays as it was on the graphics card', () => {+ const s = srv(true)+ expect(s.timeoutMs(16000 * 15)).toBe(60_000)+ expect(s.cpuRtf).toBeNull()+ s.timed(16000 * 15, 26_800)+ expect(s.cpuRtf).toBeCloseTo(1.79, 2)+ // 15 s at 1.79 x, 4 times over: room to wait behind the other track too+ expect(s.timeoutMs(16000 * 15)).toBe(Math.round(15_000 * (26_800 / 15_000) * 4))+ const g = srv(false)+ g.timed(16000 * 15, 26_800)+ expect(g.timeoutMs(16000 * 15)).toBe(60_000)+ expect(g.cpuRtf).toBeNull()+ })+ it('too slow once two readings took longer than their audio', () => {+ const s = srv(true)+ s.timed(16000 * 10, 17_000)+ expect(s.tooSlow).toBe(false)+ s.timed(16000 * 10, 18_000)+ expect(s.tooSlow).toBe(true)+ const fast = srv(true)+ fast.timed(16000 * 10, 4000); fast.timed(16000 * 10, 5000)+ expect(fast.tooSlow).toBe(false)+ })+ it('a reading that went to an older launch (another model, before a relaunch) does not count', () => {+ const s = srv(true)+ s.timed(16000 * 10, 30_000, 'http://127.0.0.1:9')+ expect(s.cpuRtf).toBeNull()+ })+})++describe.skipIf(process.platform === 'win32')('the graphics card again', () => {+ it('a server that set the graphics card aside tries it again when asked (a new meeting, a saved recording), and says why in the log', async () => {+ const bin = fakeBinary(0, ['wedge', 'wedge', 'ok'])+ const args = () => JSON.parse(readFileSync(join(bin, '../args'), 'utf8')) as string[]+ const errors = vi.spyOn(console, 'error').mockImplementation(() => {})+ const info = vi.spyOn(console, 'info').mockImplementation(() => {})+ const s = make(bin, { gpuFallback: true, backoffMs: [0, 0] })+ await s.wedged(await s.wedged(await s.url()))+ expect(s.cpuOnly).toBe(true)+ const cpu = await s.url()+ expect(args()).toContain('-ng')+ expect(s.gpuAgain('a new meeting')).toBe(true)+ expect(s.cpuOnly).toBe(false)+ expect(info.mock.calls.map((a) => a.join(' ')).some((l) => /tries the graphics card again for a new meeting; it was set aside because it hung twice on the graphics card/.test(l))).toBe(true)+ const gpu = await s.url()+ expect(gpu).not.toBe(cpu)+ expect(args()).not.toContain('-ng')+ // starting again for the graphics card is not a relaunch after trouble: none of the meeting's are used+ expect(s.launches).toBe(4)+ // already on the graphics card: nothing to do+ expect(s.gpuAgain('a new meeting')).toBe(false)+ errors.mockRestore(); info.mockRestore()+ })++ it('a Mac never needs it', () => {+ expect(createWhisperServer({ binary: '/none', model: '/m.bin' }).gpuAgain('a new meeting')).toBe(false)+ })+})+describe.skipIf(process.platform === 'win32')('two tracks failing at once', () => {it('both requests wedge, their timeouts land at different times: one kill, one relaunch, both go on in the new child', async () => {const bin = fakeBinary(600, ['wedge', 'ok'])diff --git a/app/test/pipeline.test.ts b/app/test/pipeline.test.tsindex c404e9d8..ff3ed224 100644--- a/app/test/pipeline.test.ts+++ b/app/test/pipeline.test.ts@@ -180,6 +180,39 @@ describe('pipeline when whisper falls behind', () => {await s.p.finish()expect(s.warns).toEqual(['transcribe-failed'])})++ // #156: chunks that got no lines live are never just lost: the saved recording reads the track again from there+ it('says where on each track the first chunk without lines starts: failed or dropped', async () => {+ const s = setup((c) => { if (c.track === 'them' && c.startMs === 3000) throw new Error('boom'); return [line(c, 'fine')] })+ s.speak('them', 0); s.speak('them', 3000); s.speak('them', 6000); s.speak('me', 0)+ await s.p.finish()+ expect(s.p.gaps()).toEqual({ them: 3000 })+ const g = stalled()+ const d = setup(g.say, { maxQueuedMs: 2000 })+ for (let i = 0; i < 5; i++) d.speak('them', i * 3000)+ g.release()+ await d.p.finish()+ expect(d.p.gaps()).toEqual({ them: d.p.stats().dropped[0].startMs })+ const ok = setup((c) => [line(c, 'fine')])+ ok.speak('me', 0)+ await ok.p.finish()+ expect(ok.p.gaps()).toEqual({})+ })++ it('paused, nothing more goes to whisper: what waited and what comes is left to the saved recording', async () => {+ const g = stalled()+ const s = setup(g.say)+ s.speak('them', 0); s.speak('them', 3000); s.speak('me', 6000)+ s.p.pause()+ expect(s.p.paused()).toBe(true)+ s.speak('me', 9000); s.speak('them', 12000)+ g.release()+ await s.p.finish()+ // the ones already with whisper keep their lines+ expect(g.calls.map((c) => [c.track, c.startMs])).toEqual([['them', 0], ['me', 6000]])+ expect(s.saved).toHaveLength(2)+ expect(s.p.gaps()).toEqual({ them: 3000, me: 9000 })+ })})describe('partials', () => {diff --git a/app/test/setup.test.ts b/app/test/setup.test.tsindex dabdca61..fe86553c 100644--- a/app/test/setup.test.ts+++ b/app/test/setup.test.ts@@ -503,6 +503,22 @@ describe('the speed check (Windows and Linux): speech models timed on this compuexpect(c.installed()?.asr).toContain('large-v3-turbo')})+ // #156: on a processor too slow for turbo, a smaller model already on disk can take over a meeting; none is downloaded for it+ it('lists the smaller speech models already on disk, best first, and downloads none for that', async () => {+ const s = speed({ 'whisper-large-v3-turbo-q5_0': 0.1 })+ const { c, root, rec } = setup({ getHardware: async () => gpuPc, speed: s.deps })+ mkdirSync(join(root, 'asr'), { recursive: true })+ for (const id of ['whisper-small-q5_1', 'whisper-tiny-q5_1']) { const f = join(root, 'asr', name(url(id))); writeFileSync(f, 'x'); writeFileSync(f + '.ok', 'FAKE') }+ // a file that was never checked is not offered+ writeFileSync(join(root, 'asr', name(url('whisper-base-q5_1'))), 'x')+ await c.start(); await c.idle()+ expect(c.installed()?.smallerAsr).toEqual([join(root, 'asr', name(url('whisper-small-q5_1'))), join(root, 'asr', name(url('whisper-tiny-q5_1')))])+ expect(rec.asked.filter((u) => catalog.asr.some((a) => a.url === u))).toEqual([url('whisper-large-v3-turbo-q5_0')])+ const none = setup({ getHardware: async () => gpuPc, speed: speed({ 'whisper-large-v3-turbo-q5_0': 0.1 }).deps })+ await none.c.start(); await none.c.idle()+ expect(none.c.installed()?.smallerAsr).toBeUndefined()+ })+it('a stored result on the same computer is used as it is: nothing is timed again', async () => {const s = speed({}, { key: speedKey(cpuPc), model: 'whisper-tiny-q5_1', rtf: { 'whisper-tiny-q5_1': 0.2 }, at: 1 })const { c, rec } = setup({ getHardware: async () => cpuPc, speed: s.deps })diff --git a/app/test/transcribe.test.ts b/app/test/transcribe.test.tsindex cdb0eaf7..e94abee8 100644--- a/app/test/transcribe.test.ts+++ b/app/test/transcribe.test.ts@@ -235,6 +235,30 @@ describe('transcribe', () => {const tr = createTranscriber({ url: async () => 'http://127.0.0.1:1', recover: async () => false })await expect(tr(chunk('me', 0))).rejects.toThrow()})++ // #76: a card that hangs twice moves to the processor on the second recovery; the chunk should still be read there+ it('recovers twice at most for one chunk, then gives the error', async () => {+ const s = await stub([say('Third time')])+ let calls = 0, recovers = 0+ const tr = createTranscriber({ url: async () => (calls++ < 2 ? 'http://127.0.0.1:1' : s.url), recover: async () => { recovers++; return true } })+ expect((await tr(chunk('me', 0))).map((x) => x.text)).toEqual(['Third time'])+ expect(recovers).toBe(2)+ let n = 0+ const never = createTranscriber({ url: async () => 'http://127.0.0.1:1', recover: async () => { n++; return true } })+ await expect(never(chunk('me', 0))).rejects.toThrow()+ expect(n).toBe(2)+ })++ // #156: on the processor the timeout follows its measured speed+ it('asks how long a request may take for its length, and says how long finished readings took (not quick ones)', async () => {+ const s = await stub([say('One'), say('Two')])+ const asked: number[] = [], timed: number[] = []+ const tr = createTranscriber({ url: async () => s.url, timeoutMs: (n) => { asked.push(n); return 5000 }, onTimed: (n, ms) => { timed.push(n); expect(ms).toBeGreaterThanOrEqual(0) } })+ await tr(chunk('them', 0, 2))+ await tr(chunk('them', 2000, 1), { partial: true })+ expect(asked).toEqual([32000, 16000])+ expect(timed).toEqual([32000])+ })})describe('isGarbled', () => {diff --git a/app/test/transcription.test.ts b/app/test/transcription.test.tsindex fba6bede..eebb1b2c 100644--- a/app/test/transcription.test.ts+++ b/app/test/transcription.test.ts@@ -326,7 +326,7 @@ describe('whisper-server between meetings', () => {const make = () => {const rec = { urls: 0, stops: 0 }made.push(rec)- return { url: async () => { rec.urls++; return 'http://127.0.0.1:1' }, resetBudget: () => {}, wedged: async () => 'http://127.0.0.1:1', alive: async () => true, kill: () => {}, stop: async () => { rec.stops++ } } as unknown as import('../src/main/asr/server').WhisperServer+ return { url: async () => { rec.urls++; return 'http://127.0.0.1:1' }, resetBudget: () => {}, gpuAgain: () => false, timeoutMs: () => 30_000, timed: () => {}, tooSlow: false, cpuRtf: null, wedged: async () => 'http://127.0.0.1:1', alive: async () => true, kill: () => {}, stop: async () => { rec.stops++ } } as unknown as import('../src/main/asr/server').WhisperServer}return { made, make }}@@ -395,6 +395,116 @@ describe('whisper-server between meetings', () => {})})+// #156: on a processor too slow for the model, live transcription gave up mid-meeting, and the audio it missed was never read+describe('when whisper cannot keep up', () => {+ /** a whisper-server stand-in that answers every request with one line */+ async function inference() {+ const { createServer } = await import('node:http')+ const srv = createServer((q, r) => { q.resume(); q.on('end', () => r.end(JSON.stringify({ detected_language: 'english', detected_language_probability: 0.99, segments: [{ start: 0, end: 0.5, text: ' Fine words here today' }] }))) })+ await new Promise<void>((res) => srv.listen(0, '127.0.0.1', () => res()))+ disposers.push(() => srv.close())+ return `http://127.0.0.1:${(srv.address() as { port: number }).port}`+ }+ /** stand-in servers on the processor that judge themselves too slow once they have read `slowAfter` chunks */+ function servers(url: string, slowAfter = 1) {+ const made: Array<{ model: string; timed: number; gpuAgain: string[] }> = []+ const make = (model: string) => {+ const rec = { model, timed: 0, gpuAgain: [] as string[] }+ made.push(rec)+ return { url: async () => url, resetBudget: () => {}, gpuAgain: (why: string) => { rec.gpuAgain.push(why); return false }, timeoutMs: () => 30_000,+ timed: () => { rec.timed++ }, get tooSlow() { return rec.timed >= slowAfter }, cpuRtf: 1.8, cpuOnly: true, slow: () => {},+ wedged: async () => url, alive: async () => true, kill: () => {}, stop: async () => {} } as unknown as import('../src/main/asr/server').WhisperServer+ }+ return { made, make }+ }+ function hooks(make: (model: string) => import('../src/main/asr/server').WhisperServer, smaller: string[] = [], capture = true) {+ const starts: Array<(m: Meeting) => void> = [], stops: Array<(m: Meeting) => void> = []+ const warns: string[] = [], queued: string[] = []+ disposers.push(hookTranscription({+ store, modelPath: () => '/turbo.bin', smallerModels: () => smaller, send: () => {}, warn: (c) => warns.push(c), server: make, serverIdleMs: 60_000, holdMs: 0,+ queued: (id) => queued.push(id), onStart: (fn) => { starts.push(fn) }, onStop: (fn) => { stops.push(fn) },+ }))+ const procs: ReturnType<typeof fakeProc>[] = []+ if (capture) hookCapture({+ dirOf: (id) => `/m/${id}`, onStart: (fn) => { starts.push(fn); return () => {} }, onStop: (fn) => { stops.push(fn); return () => {} }, stopMeeting: () => {},+ start: (_d, o) => { const f = fakeProc(); procs.push(f); return new Capture(f.proc, { startMs: o?.startMs }) }, join: async () => {},+ })+ return { warns, queued, procs, begin: (m: Meeting) => starts.forEach((f) => f(m)),+ end: async (m: Meeting) => { stops.forEach((f) => f(m)); procs.at(-1)?.exit(0); await recordingFinished(m.id); await settleTranscription(5000) } }+ }+ const quietly = () => { const w = vi.spyOn(console, 'warn').mockImplementation(() => {}); return () => w.mockRestore() }++ it('too slow on the processor with no smaller model: live transcription pauses, says so, and the saved recording finishes it', async () => {+ const restore = quietly()+ const s = servers(await inference())+ const h = hooks(s.make)+ const m = meeting()+ h.begin(m)+ h.procs[0].say('them', 500)+ await vi.waitFor(() => expect(h.warns).toEqual(['live-paused']))+ h.procs[0].say('them', 4000)+ await tick()+ await h.end(m)+ expect(store.segments(m.id).map((x) => x.startMs)).toEqual([500])+ expect(store.meeting(m.id)?.transcriptionState).toBe('queued')+ expect(h.queued).toEqual([m.id])+ restore()+ })++ it('too slow on the processor with a smaller model on disk: that one takes over and live transcription goes on', async () => {+ const restore = quietly()+ const s = servers(await inference())+ const h = hooks(s.make, ['/small.bin'])+ const m = meeting()+ h.begin(m)+ h.procs[0].say('them', 500)+ await vi.waitFor(() => expect(s.made.map((x) => x.model)).toEqual(['/turbo.bin', '/small.bin']))+ h.procs[0].say('them', 4000)+ await vi.waitFor(() => expect(s.made[1].timed).toBe(1))+ // the smaller one is too slow as well: nothing smaller is left, so it pauses+ expect(h.warns).toEqual(['live-paused'])+ await h.end(m)+ expect(store.segments(m.id).map((x) => x.startMs)).toEqual([500, 4000])+ restore()+ })++ it('a chunk that got no lines: the lines after it on that track go, and the saved recording reads the track again from there', async () => {+ const errors = vi.spyOn(console, 'error').mockImplementation(() => {})+ const restore = quietly()+ const refreshed: string[] = []+ const r = rig('transcription-first', { refresh: (id) => refreshed.push(id), holdMs: 0, transcriber: async (c) => { if (c.track === 'them' && c.startMs === 4000) throw new Error('boom'); return says(c) } })+ const m = meeting()+ r.begin(m)+ r.procs[0].say('them', 500); r.procs[0].say('me', 500)+ await tick()+ r.procs[0].say('them', 4000)+ await tick()+ r.procs[0].say('them', 8000); r.procs[0].say('me', 8000)+ await tick()+ await r.stop(m)+ expect(store.segments(m.id, { hidden: true }).map((x) => `${x.track}@${x.startMs}`).sort()).toEqual(['me@500', 'me@8000', 'them@500'])+ expect(store.meeting(m.id)?.transcriptionState).toBe('queued')+ expect(refreshed).toContain(m.id)+ errors.mockRestore(); restore()+ })++ it('the graphics card gets another chance at each meeting and before a saved recording, never while another meeting uses the server', async () => {+ const s = servers('http://127.0.0.1:1', Infinity)+ const h = hooks(s.make, [], false)+ const a = meeting()+ h.begin(a)+ const b = meeting()+ h.begin(b)+ expect(s.made[0].gpuAgain).toEqual(['a new meeting'])+ await h.end(a); await h.end(b)+ const c = meeting()+ store.updateMeeting(c.id, { state: 'stopped', transcriptionPending: true })+ async function* none(): AsyncGenerator<Float32Array> { yield new Float32Array(0) }+ await transcribeRecorded(c.id, { them: none() })+ expect(s.made[0].gpuAgain).toEqual(['a new meeting', 'a saved recording'])+ })+})+describe('the spoken language picked', () => {/** Apple's speech on a Mac with English and Spanish models, the last meeting in Spanish */async function speechRig(spoken: () => Spoken) {diff --git a/app/test/widgetModel.test.ts b/app/test/widgetModel.test.tsindex 69ba984f..207e0113 100644--- a/app/test/widgetModel.test.ts+++ b/app/test/widgetModel.test.ts@@ -124,7 +124,7 @@ describe('transcription hints', () => {const w = new WidgetModel()w.start(m)w.warn('transcribe-failed')- expect(hintAt(w)).toBe("Some of this meeting couldn't be transcribed.")+ expect(hintAt(w)).toBe('Some lines are missing for now. Yogurt will fill them in from the recording after the meeting.')w.warn('no-speech-model')expect(hintAt(w)).toBe("The speech model isn't ready yet, so only audio is being saved.")w.warn('falling-behind')@@ -135,6 +135,18 @@ describe('transcription hints', () => {w.start(m)expect(hintAt(w)).toBeUndefined()})+ // #156: transcription stopped mid-meeting with nothing on screen to say so+ it('says when live transcription has paused and that the recording finishes it; later hints do not hide that', () => {+ const w = new WidgetModel()+ w.start(m)+ w.warn('transcribe-failed')+ w.warn('live-paused')+ expect(hintAt(w)).toBe('Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.')+ w.warn('falling-behind')+ expect(hintAt(w)).toBe('Live transcription paused. Yogurt will finish the transcript from the recording after the meeting.')+ w.start(m)+ expect(hintAt(w)).toBeUndefined()+ })})describe('renaming the meeting while it records', () => {