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.

Recording: mute your mic in Yogurt from the note's header or the recording pill; the mic is silenced at capture on Mac, Windows and Linux while call audio and the timer keep going, a red mic-off follows the time, and the mic stays off through pause and resume (#118)

Eric Brownroutb0ebee489a2e
diff --git a/app/e2e/callControls.spec.ts b/app/e2e/callControls.spec.ts
index a2bc6824..3b348f75 100644
--- a/app/e2e/callControls.spec.ts
+++ b/app/e2e/callControls.spec.ts
@@ -47,7 +47,9 @@ test('paused recording controls fit the minimum window and keep focus inside eac
expect(box!.x).toBeGreaterThanOrEqual(0)
expect(box!.x + box!.width).toBeLessThanOrEqual(720)
expect(box!.height).toBe(30)
- await expect(buttons).toHaveCount(2)
+ await expect(buttons).toHaveCount(3)
+ const mic = group.getByRole('button', { name: 'Mute my mic', exact: true })
+ await expect(mic).toBeDisabled()
await expect(page.getByTestId('note-pause')).toHaveText('')
await expect(page.getByTestId('note-pause')).toHaveAccessibleName('Resume recording')
await page.keyboard.press('Tab')
@@ -76,6 +78,7 @@ test('paused recording controls fit the minimum window and keep focus inside eac
await group.evaluate((el, value) => { el.dataset.treatment = value! }, selected)
await page.getByTestId('note-pause').click()
await expect(page.getByTestId('note-state')).toHaveAttribute('data-paused', 'false')
+ await expect(mic).toBeEnabled()
await expect(page.getByTestId('note-wave')).toBeVisible()
await expect(group).not.toContainText('Recording')
await page.getByTestId('note-stop').click()
diff --git a/app/e2e/liveTranscript.spec.ts b/app/e2e/liveTranscript.spec.ts
index 52b8b568..5b78beaa 100644
--- a/app/e2e/liveTranscript.spec.ts
+++ b/app/e2e/liveTranscript.spec.ts
@@ -66,6 +66,32 @@ async function checkSteady(page: Page) {
}
for (const speech of [false, true]) {
+ test(`muting keeps the ${speech ? 'Apple' : 'Whisper'} mic line in its original bubble until the final arrives`, async ({}, testInfo) => {
+ const { app, page } = await launch(speech ? { YOGURT_FAKE_SPEECH: '1' } : {})
+ try {
+ await record(page)
+ await start(app, page)
+ const mic = page.getByTestId('note-mic')
+ const bubble = page.locator('[data-testid="transcript-bubble"][data-track="me"]').first()
+ await expect(bubble.getByTestId('transcript-partial')).toContainText('Hi,', { timeout: 15_000 })
+ await bubble.evaluate(el => el.setAttribute('data-original-mic-row', ''))
+ const original = page.locator('[data-original-mic-row]')
+ await mic.click()
+ await expect(mic).toHaveAttribute('aria-pressed', 'true')
+ await expect(original.getByTestId('transcript-partial')).toContainText('Hi,')
+ await original.screenshot({ path: testInfo.outputPath('mic-muted-pending.png') })
+ await expect(original.getByTestId('transcript-line')).toContainText('Hi,', { timeout: 20_000 })
+ await expect(original.getByTestId('transcript-partial')).toHaveCount(0)
+ await original.screenshot({ path: testInfo.outputPath('mic-muted-final.png') })
+ await expect(page.locator('[data-testid="transcript-line"][data-track="me"]')).toHaveCount(1)
+ const snapshots = await page.evaluate(() => (window as unknown as { __snaps: Array<{ me: string }> }).__snaps)
+ const first = snapshots.findIndex(s => s.me.includes('Hi,'))
+ expect(first).toBeGreaterThanOrEqual(0)
+ expect(snapshots.slice(first).every(s => s.me.match(/Hi,/g)?.length === 1)).toBe(true)
+ await expect(page.locator('[data-testid="transcript-line"][data-track="them"]').first()).toBeVisible({ timeout: 20_000 })
+ } finally { await app.close() }
+ })
+
test(`live words ${speech ? "from Apple's speech" : 'from whisper'} never show twice and never vanish once shown`, async () => {
const { app, page } = await launch(speech ? { YOGURT_FAKE_SPEECH: '1' } : {})
try {
diff --git a/app/e2e/noteFooter.spec.ts b/app/e2e/noteFooter.spec.ts
index 65cc5cd8..22e36669 100644
--- a/app/e2e/noteFooter.spec.ts
+++ b/app/e2e/noteFooter.spec.ts
@@ -20,6 +20,7 @@ test('recording controls stay in the header and Ask lives in the footer with sta
})).toBe(true)
await reminder.getByRole('button', { name: 'Close', exact: true }).click()
await expect(page.locator('.note-footer')).toHaveCSS('margin-block-end', '0px')
+ await expect(page.locator('.note-footer').getByRole('status').filter({ hasText: 'Mic on in Yogurt' })).toHaveText('Mic on in Yogurt')
await expect(page.getByTestId('note-notes-tab')).toHaveAttribute('aria-selected', 'true')
await page.getByTestId('note-transcript-toggle').click()
const header = page.locator('.note-header'), controls = header.getByTestId('note-state')
@@ -27,6 +28,10 @@ test('recording controls stay in the header and Ask lives in the footer with sta
await expect(header.getByTestId('note-elapsed')).toBeVisible()
await expect(controls.locator('time, [data-testid="note-wave"]')).toHaveCount(0)
await expect(controls).toHaveAccessibleName('Recording')
+ const mic = controls.getByRole('button', { name: 'Mute my mic', exact: true })
+ await expect(mic).toHaveAttribute('aria-pressed', 'false')
+ await mic.hover()
+ await expect(page.getByRole('tooltip', { name: 'Mute my mic in Yogurt' })).toBeVisible()
await expect(controls.getByTestId('note-pause')).toBeVisible()
await expect(controls.getByTestId('note-stop')).toBeVisible()
await expect(controls).toHaveCSS('border-top-width', '1px')
@@ -74,7 +79,7 @@ test('recording controls stay in the header and Ask lives in the footer with sta
return [Math.round(middle.left - left.right), Math.round(right.left - middle.right)]
})
expect(gaps).toEqual([8, 8])
- const targets = [page.getByTestId('note-pause'), page.getByTestId('note-stop'), page.getByTestId('chat-open'), page.getByTestId('note-transcript-toggle'), page.getByTestId('note-notes-tab')]
+ const targets = [mic, page.getByTestId('note-pause'), page.getByTestId('note-stop'), page.getByTestId('chat-open'), page.getByTestId('note-transcript-toggle'), page.getByTestId('note-notes-tab')]
const width = await page.evaluate(() => innerWidth)
for (const target of targets) {
await expect(target).toBeInViewport()
@@ -92,7 +97,7 @@ test('recording controls stay in the header and Ask lives in the footer with sta
await page.evaluate(() => document.documentElement.dir = 'ltr')
// The effective viewport of a720×520 window zoomed to1.6× still exposes every primary action.
await page.setViewportSize({ width: 450, height: 325 })
- for (const id of ['note-pause', 'note-stop', 'note-transcript-toggle', 'note-notes-tab']) {
+ for (const id of ['note-mic', 'note-pause', 'note-stop', 'note-transcript-toggle', 'note-notes-tab']) {
await expect(page.getByTestId(id)).toBeInViewport()
const box = (await page.getByTestId(id).boundingBox())!
expect(box.x).toBeGreaterThanOrEqual(0)
diff --git a/app/e2e/widget.spec.ts b/app/e2e/widget.spec.ts
index fd83e1df..1a2fcdcc 100644
--- a/app/e2e/widget.spec.ts
+++ b/app/e2e/widget.spec.ts
@@ -8,11 +8,11 @@ const main = join(import.meta.dirname, '../out/main/index.js')
const zoom = { bundleId: 'us.zoom.xos', name: 'zoom.us' }
type Snap = { visible: boolean; view: { kind: string; note: { text: string } | null; crashed: boolean } | null; notice: { title: string; body: string; meetingId: string } | null; bounds: { x: number; y: number; width: number; height: number } | null; workArea: { x: number; y: number; width: number; height: number } }
-async function launch(settings?: object) {
+async function launch(settings?: object, micAck?: string) {
const userData = mkdtempSync(join(tmpdir(), 'yogurt-e2e-'))
if (settings) writeFileSync(join(userData, 'settings.json'), JSON.stringify(settings))
// These tests control foreground/background explicitly instead of competing for native focus.
- const app = await electron.launch({ args: [main], env: { ...process.env, YOGURT_BACKGROUND: '1', YOGURT_FAKE: '1', YOGURT_USER_DATA: userData } })
+ const app = await electron.launch({ args: [main], env: { ...process.env, YOGURT_BACKGROUND: '1', YOGURT_FAKE: '1', YOGURT_USER_DATA: userData, ...(micAck && { YOGURT_FAKE_MIC_ACK: micAck }) } })
// the config's actionTimeout never reaches Electron's windows: without this a click that can't land waits out the
// whole test, and the stuck app then holds up the worker's teardown too (how "pause says Paused" failed once)
app.context().setDefaultTimeout(15_000)
@@ -74,6 +74,156 @@ test('the widget is a compact horizontal recorder with one live wave and no exte
} finally { await app.close() }
})
+test('the header and expanded card share confirmed mute, across collapse, reload and pause', async ({}, testInfo) => {
+ const { app, page } = await launch(undefined, 'slow')
+ try {
+ const w = await record(app, page)
+ const pill = w.getByTestId('widget')
+ const header = page.getByTestId('note-mic'), card = w.getByTestId('widget-mic')
+ const presented = (await fake<{ presented: number }>(app, 'main')).presented
+ // Review captures of each mic state in both themes; CI keeps them with the ui-review artifact.
+ const capture = async (name: string) => {
+ for (const colorScheme of ['light', 'dark'] as const) {
+ await page.emulateMedia({ colorScheme }); await w.emulateMedia({ colorScheme })
+ const details = name.endsWith('card') ? ['logo', 'widget-wave', 'widget-time', 'widget-mic']
+ : name === 'off-collapsed' ? ['logo', 'widget-wave', 'widget-time', 'widget-mic-off'] : ['logo', 'widget-wave', 'widget-time']
+ await expect.poll(() => pill.evaluate((el, ids) => {
+ const boxes = ids.map(id => el.querySelector(`[data-testid="${id}"]`)?.getBoundingClientRect())
+ if (!boxes.every((box, i) => box && (i === 0 || box.left > boxes[i - 1]!.right))) return false
+ const divider = el.querySelector('.widget-mic-status')?.getBoundingClientRect()
+ if (!divider) return !ids.includes('widget-mic-off')
+ const [logo, , time, mic] = boxes
+ const pill = el.getBoundingClientRect()
+ return Math.round(divider.left - time!.right) === 12 && Math.round(mic!.left - divider.left) === 13
+ && Math.abs((pill.right - mic!.right) - (logo!.left - pill.left)) < 1
+ && divider.top - pill.top === 9 && pill.bottom - divider.bottom === 9
+ && mic!.width === 24 && mic!.height === 24
+ }, details)).toBe(true)
+ await page.getByTestId('note-state').locator('..').screenshot({ path: testInfo.outputPath(`mic-${name}-header-${colorScheme}.png`) })
+ await pill.screenshot({ path: testInfo.outputPath(`mic-${name}-pill-${colorScheme}.png`) })
+ }
+ await page.emulateMedia({ colorScheme: null }); await w.emulateMedia({ colorScheme: null })
+ }
+ await expect(card).toHaveCount(0)
+ await expect(w.getByTestId('widget-mic-off')).toHaveCount(0)
+ await capture('on-collapsed')
+ await pill.hover()
+ await expect(card).toHaveAccessibleName('Mute my mic')
+ await capture('on-card')
+ await card.click()
+ await expect(header).toHaveAttribute('aria-busy', 'true')
+ await expect(card).toBeDisabled()
+ await expect(header).toHaveAccessibleName('Unmute my mic')
+ await expect(card).toHaveAttribute('aria-pressed', 'true')
+ await expect(w.getByTestId('widget-mic-off')).toHaveCount(0)
+ await capture('off-card')
+ await w.mouse.move(0, 0)
+ await expect(pill).toHaveAttribute('data-open', 'false')
+ await expect(w.getByTestId('widget-mic-off')).toBeVisible()
+ await expect(w.getByTestId('logo')).toBeVisible()
+ await capture('off-collapsed')
+ expect((await fake<{ presented: number }>(app, 'main')).presented).toBe(presented)
+ await page.reload()
+ await expect(header).toHaveAttribute('aria-pressed', 'true')
+ await page.getByTestId('note-pause').click()
+ await expect(header).toBeDisabled()
+ await expect(page.getByText('Mic will stay off on resume')).toBeVisible()
+ await page.screenshot({ path: testInfo.outputPath('mic-paused-note.png') })
+ await page.getByTestId('note-pause').click()
+ await header.press('Space')
+ await expect(page.getByText('Unmuting mic…')).toBeVisible()
+ await expect(header).toHaveAttribute('aria-pressed', 'false')
+ await expect(w.getByTestId('widget-mic-off')).toHaveCount(0)
+ await pill.hover()
+ await expect(card).toHaveAccessibleName('Mute my mic')
+ await page.getByTestId('note-stop').click()
+ } finally { await app.close() }
+})
+
+test('one card click changes the mic icon once in each window, after confirmation', async ({}, testInfo) => {
+ const { app, page } = await launch(undefined, 'slow')
+ try {
+ const w = await record(app, page)
+ const pill = w.getByTestId('widget'), card = w.getByTestId('widget-mic')
+ await pill.hover()
+ await card.click({ trial: true })
+ const header = page.getByTestId('note-mic')
+ const preview = w.getByTestId('widget-preview-text')
+ const top = await preview.evaluate(el => el.getBoundingClientRect().top)
+ const watches = await Promise.all([card, header].map(button => button.evaluateHandle(el => {
+ const states: string[] = [], icons: string[] = [], statusDelays: number[] = []
+ const feedback = el.closest('.widget-pill')?.querySelector('.widget-preview > [role="status"]')
+ let pendingAt: number | undefined
+ const take = () => {
+ const state = el.getAttribute('aria-pressed')!
+ const icon = el.querySelector('svg')!.innerHTML
+ if (states.at(-1) !== state) states.push(state)
+ if (icons.at(-1) !== icon) icons.push(icon)
+ if (el.getAttribute('aria-busy') === 'true') pendingAt ??= performance.now()
+ else pendingAt = undefined
+ }
+ take()
+ new MutationObserver(take).observe(el, { attributes: true, childList: true, subtree: true })
+ if (feedback) new MutationObserver(() => {
+ if (pendingAt !== undefined && feedback.classList.contains('mic-pending-status')) statusDelays.push(performance.now() - pendingAt)
+ }).observe(feedback, { attributes: true, attributeFilter: ['class'] })
+ return { states, icons, statusDelays }
+ })))
+ for (const [action, previous, next] of [['Muting', 'false', 'true'], ['Unmuting', 'true', 'false']] as const) {
+ await card.click()
+ await expect(card).toBeDisabled()
+ await expect(card).toHaveAttribute('aria-pressed', previous)
+ // A second click in either window while the helper is busy cannot issue the opposite command.
+ for (const button of [card, header]) await button.evaluate(el => (el as HTMLButtonElement).click())
+ const status = w.getByText(`${action} mic…`, { exact: true })
+ await expect(status).toBeVisible()
+ expect(await preview.evaluate(el => el.getBoundingClientRect().top)).toBeCloseTo(top, 0)
+ await pill.screenshot({ path: testInfo.outputPath(`mic-${action.toLowerCase()}-pending-card.png`) })
+ await expect(card).toHaveAttribute('aria-pressed', next)
+ await expect(header).toHaveAttribute('aria-pressed', next)
+ await expect(status).toBeHidden()
+ }
+ for (const watch of watches) {
+ const { states, icons } = await watch.jsonValue()
+ expect(states).toEqual(['false', 'true', 'false'])
+ expect(icons).toHaveLength(3)
+ expect(icons[0]).toEqual(icons[2])
+ expect(icons[1]).not.toEqual(icons[0])
+ }
+ const { statusDelays } = await watches[0].jsonValue()
+ expect(statusDelays).toHaveLength(2)
+ for (const delay of statusDelays) expect(delay).toBeGreaterThanOrEqual(650)
+ } finally { await app.close() }
+})
+
+test('a failed unmute keeps the mic off and the separate call audio warning visible', async () => {
+ const { app, page } = await launch(undefined, 'stay-off')
+ try {
+ const w = await record(app, page)
+ await page.getByTestId('note-mic').click()
+ await fake(app, 'warn', 'no-system-audio')
+ const card = w.getByRole('button', { name: 'Unmute my mic', exact: true })
+ await card.click()
+ await expect(w.getByText('Mic is still off. Try again.', { exact: true })).toBeVisible()
+ await expect(card).toBeEnabled()
+ await expect(page.getByTestId('note-mic')).toHaveAttribute('aria-pressed', 'true')
+ await expect(w.getByTestId('widget-note')).toHaveText('Mic off. Yogurt can’t hear call audio.')
+ await expect(w.getByTestId('logo')).toBeVisible()
+ } finally { await app.close() }
+})
+
+test('a lost mute reply closes the recording and explains the failure in the note', async () => {
+ const { app, page } = await launch(undefined, 'missing')
+ try {
+ await record(app, page)
+ await page.getByRole('button', { name: 'Mute my mic', exact: true }).click()
+ await expect(page.getByTestId('note-mic')).toHaveAttribute('aria-busy', 'true')
+ await expect(page.getByTestId('note-mic')).toHaveAttribute('aria-pressed', 'false')
+ await expect(page.getByTestId('note-state')).toHaveAttribute('data-state', /^(stopped|done)$/, { timeout: 15000 })
+ await expect(page.getByText('Mic mute couldn’t be confirmed.', { exact: true })).toBeVisible()
+ } finally { await app.close() }
+})
+
test('Stop closes the floating recorder and prepares a completion notification', async () => {
const { app, page } = await launch()
try {
diff --git a/app/native/yogurt-audio-linux/smoke/smoke.py b/app/native/yogurt-audio-linux/smoke/smoke.py
index 47b65aa5..8ae2759f 100644
--- a/app/native/yogurt-audio-linux/smoke/smoke.py
+++ b/app/native/yogurt-audio-linux/smoke/smoke.py
@@ -204,6 +204,31 @@ check(r.wait_for(lambda m: m["t"] == "warn" and m["code"] == "mic-gone", since=n
m = r.wait_for(lambda m: m["t"] == "mic" and m["uid"] is None, since=n0, timeout=5)
check(m is not None and m["name"] == "VirtualMic", "and goes back to Auto")
time.sleep(1.5)
+def input_stream_ids():
+ return {line.split()[0] for line in pactl("list", "short", "source-outputs").splitlines() if line.strip()}
+
+before_mute = input_stream_ids()
+mute_at = time.time() - r.t0
+r.send("mute 1")
+muted = r.wait_for(lambda m: m["t"] == "mic-muted" and m["id"] == 1 and m["muted"])
+check(muted is not None, "helper confirms mic off")
+check(muted is not None and muted["_at"] - mute_at < 0.2, "warm mute confirms within 200 ms")
+check(before_mute and input_stream_ids() == before_mute, "mute keeps the same input stream open")
+r.send("mic virtmic")
+time.sleep(1.2)
+before_unmute = input_stream_ids()
+unmute_at = time.time() - r.t0
+r.send("unmute 2")
+unmuted = r.wait_for(lambda m: m["t"] == "mic-muted" and m["id"] == 2 and not m["muted"])
+check(unmuted is not None, "helper confirms the selected mic is back on")
+check(unmuted is not None and unmuted["_at"] - unmute_at < 0.2, "warm unmute confirms within 200 ms")
+check(before_unmute and input_stream_ids() == before_unmute, "unmute reuses the selected input stream")
+if muted and unmuted:
+ interval = r.lines[r.lines.index(muted) + 1:r.lines.index(unmuted)]
+ check(not any(m["t"] == "pcm" and m["track"] == "me" for m in interval), "no mic PCM between acknowledgments")
+ check(any(m["t"] == "pcm" and m["track"] == "them" and rms(m["samples"]) > 0.05 for m in interval), "call tone continues while muted")
+check(r.wait_for(lambda m: m["t"] == "pcm" and m["track"] == "me" and rms(m["samples"]) > 0.05,
+ since=r.lines.index(unmuted) + 1 if unmuted else len(r.lines)) is not None, "fresh mic audio after unmuting")
r.send("bogus")
elapsed = time.time() - r.t0
code = r.stop()
@@ -235,6 +260,13 @@ for track in ["me", "them"]:
f = os.path.join(meet, track + ".ogg")
check(os.path.exists(f), f + " exists")
check(ffmpeg_clean(f), track + ".ogg decodes with ffmpeg without errors")
+ if muted and unmuted:
+ # Skip codec overlap at the two edges. The body of the protected interval loses only the mic tone.
+ raw = subprocess.check_output([helper, "decode", f])
+ lo, hi = (int((muted["ms"] + 100) * 16), int((unmuted["ms"] - 100) * 16))
+ samples = struct.unpack("<%df" % (len(raw) // 4), raw)[lo:hi]
+ check(len(samples) == hi - lo and (rms(samples) < 0.001 if track == "me" else rms(samples) > 0.05),
+ track + ".ogg preserves the mute interval on meeting time")
sec = ffprobe_seconds(f)
check(abs(sec - elapsed) < 2.0, "%s.ogg lasts the recording (%.2f s of %.2f s)" % (track, sec, elapsed))
check(mean_db(f) > -35, "%s.ogg is not silent (%.1f dB)" % (track, mean_db(f)))
@@ -247,10 +279,11 @@ check(code == 0 and all(0 < info["tracks"][t]["bitsPerSecond"] < 40000 for t in
first_ms = info.get("durationMs", 0)
# --- a restart: part 1 on meeting time, then join ----------------------------------------------------
-r2 = Run(["record", "--dir", meet, "--part", "1", "--start-ms", str(first_ms)])
+r2 = Run(["record", "--dir", meet, "--part", "1", "--start-ms", str(first_ms), "--mic-muted"])
time.sleep(3)
code = r2.stop(eof=True)
check(code == 0, "end of stdin finishes and exits 0 (got %s)" % code)
+check(not r2.of("pcm", track="me"), "a replacement helper is muted from its first sample through Stop")
pcm = r2.of("pcm", track="them")
check(pcm and pcm[0]["ms"] >= first_ms, "part 1's pcm carries on from --start-ms (%s >= %s)" % (pcm and pcm[0]["ms"], first_ms))
check(os.path.exists(os.path.join(meet, "me.1.ogg")) and os.path.exists(os.path.join(meet, "them.1.ogg")), "part 1 writes me.1.ogg and them.1.ogg")
diff --git a/app/native/yogurt-audio-linux/src/main.rs b/app/native/yogurt-audio-linux/src/main.rs
index f8fb0549..d6d73b33 100644
--- a/app/native/yogurt-audio-linux/src/main.rs
+++ b/app/native/yogurt-audio-linux/src/main.rs
@@ -1,7 +1,7 @@
// Yogurt's recorder on Linux: the microphone and the computer's sound (the default output's monitor) through
// PulseAudio, which PipeWire answers too (pipewire-pulse). No echo cancelling and no voice processing: the call
// app keeps the mic as it is. It speaks exactly what app/native/yogurt-audio (the Mac's) speaks:
-// yogurt-audio record --dir DIR [--part N --start-ms X] [--mic UID] [--speech LOCALE]
+// yogurt-audio record --dir DIR [--part N --start-ms X] [--mic-muted] [--mic UID] [--speech LOCALE]
// yogurt-audio join --dir DIR | inspect --dir DIR | compact --dir DIR --out STAGING
// yogurt-audio speech-locales | speech-install LOCALE | mic-devices
// Files are Ogg Opus (48 kHz mono, 20 kb/s): DIR/me.ogg and DIR/them.ogg, or me.N.ogg and them.N.ogg for part N,
@@ -9,6 +9,7 @@
// {"t":"pcm","track":"me"|"them","ms","n"} {"t":"level","me","them"} 10 times a second
// {"t":"warn","code":"no-system-audio"|"device-changed"|"no-mic"|"mic-gone"} {"t":"mic","uid","name"}
// {"t":"speech-off"} when --speech was asked for: there is no Apple speech here, whisper reads everything
+// mute ID and unmute ID reply with {"t":"mic-muted","id":ID,"muted":bool,"ms":meeting time}.
// stdin: pause, resume, stop (end of input also stops), mic UID or mic auto. A mic's UID is its PulseAudio source name.
mod join;
@@ -68,7 +69,7 @@ fn arg_value(args: &[String], name: &str) -> Option<String> {
enum Tr { Me, Them }
enum Msg {
- Audio { track: Tr, gen: u64, samples: Vec<f32>, arrived: f64 },
+ Audio { track: Tr, gen: u64, samples: Vec<f32>, arrived: f64, heard: Option<f64> },
Lost { track: Tr, gen: u64 },
Cmd(String),
/// stdin closed (Yogurt quit or crashed) or stdout broke (Yogurt gone): keep what we have
@@ -86,6 +87,9 @@ struct Recorder {
sys: Option<Capture>,
mic_gen: u64,
sys_gen: u64,
+ mic_muted: bool,
+ mic_from: Option<f64>,
+ start_ms: f64,
paused: bool,
finishing: bool,
/// the mic the person chose (its source name); None is Auto, the default input, followed as it changes
@@ -119,7 +123,10 @@ impl Recorder {
let (tx, tx2, clock) = (self.tx.clone(), self.tx.clone(), self.clock.clone());
let name = match track { Tr::Me => "microphone", Tr::Them => "computer sound" };
pulse::capture(device, name,
- move |samples| { let _ = tx.send(Msg::Audio { track, gen, samples, arrived: clock.ms() }); },
+ move |samples, at| {
+ let heard = at.and_then(|t| t.checked_duration_since(clock.0)).map(|d| d.as_secs_f64() * 1000.0);
+ let _ = tx.send(Msg::Audio { track, gen, samples, arrived: clock.ms(), heard });
+ },
move || { let _ = tx2.send(Msg::Lost { track, gen }); })
}
@@ -224,6 +231,22 @@ impl Recorder {
match c {
"pause" => { self.paused = true; self.me.flush_pending(); self.them.flush_pending() }
"resume" => { self.paused = false; self.me.resync(); self.them.resync() }
+ _ if c.starts_with("mute ") || c.starts_with("unmute ") => {
+ let Some((action, id)) = c.split_once(' ') else { return };
+ let Ok(id) = id.parse::<u32>() else { return };
+ let off = action == "mute";
+ let boundary = (self.start_ms + self.clock.ms().max(self.me.pts as f64 / 48.0)).ceil() - self.start_ms;
+ let changing = off != self.mic_muted;
+ if changing {
+ self.me.resync();
+ self.me.level();
+ self.mic_muted = off || self.mic.is_none();
+ if !self.mic_muted { self.mic_from = Some(boundary); }
+ if !off && self.mic.is_none() { self.schedule_mic(0); }
+ }
+ self.send(obj([("t", s("mic-muted")), ("id", n(id as f64)), ("muted", J::Bool(self.mic_muted)), ("ms", n((self.start_ms + boundary).ceil()))]));
+ if changing { self.me.pad_to((boundary * 48.0).ceil() as u64); }
+ }
"stop" => self.finish(),
_ if c.starts_with("mic ") => { let a = c[4..].trim().to_string(); self.choose_mic(&a) }
_ => eprintln!("unknown command: {c}"),
@@ -232,10 +255,18 @@ impl Recorder {
fn handle(&mut self, m: Msg) {
match m {
- Msg::Audio { track, gen, samples, arrived } => {
+ Msg::Audio { track, gen, samples, arrived, heard } => {
if self.paused || self.finishing { return }
match track {
- Tr::Me if gen == self.mic_gen && self.mic.is_some() => self.me.append(&samples, None, arrived),
+ Tr::Me if !self.mic_muted && gen == self.mic_gen && self.mic.is_some() => {
+ let skip = if let Some(from) = self.mic_from {
+ let Some(at) = heard else { return };
+ ((from - at) * 48.0).ceil() as usize
+ } else { 0 };
+ if skip < samples.len() {
+ self.me.append(&samples[skip..], None, arrived);
+ }
+ }
// the speakers' stream says when it heard each buffer: the time it arrived, less its length
Tr::Them if gen == self.sys_gen && self.sys.is_some() => self.them.append(&samples, Some(arrived - samples.len() as f64 / 48.0), arrived),
_ => {}
@@ -259,6 +290,7 @@ impl Recorder {
fn finish(&mut self) {
if self.finishing { return }
self.finishing = true;
+ if self.mic_muted { self.me.pad_to((self.clock.ms() * 48.0) as u64); }
if let Some(c) = self.mic.take() { c.stop() }
if let Some(c) = self.sys.take() { c.stop() }
self.me.flush_pending();
@@ -288,6 +320,7 @@ impl Recorder {
if now >= next_level {
next_level += Duration::from_millis(100);
if next_level < now { next_level = now + Duration::from_millis(100) }
+ if self.mic_muted && !self.paused { self.me.pad_to((self.clock.ms() * 48.0) as u64); }
let (me, them) = if self.paused { (0.0, 0.0) } else { (self.me.level(), self.them.level()) };
self.send(obj([("t", s("level")), ("me", n(me)), ("them", n(them))]));
}
@@ -364,6 +397,7 @@ fn record(args: &[String], dir: &Path) {
me: Track::new("me", dir, part, start_ms, Box::new(move |d| { let _ = o1.send(d); })),
them: Track::new("them", dir, part, start_ms, Box::new(move |d| { let _ = o2.send(d); })),
mic: None, sys: None, mic_gen: 0, sys_gen: 0, paused: false, finishing: false,
+ mic_muted: args.iter().any(|a| a == "--mic-muted"), mic_from: None, start_ms,
mic_uid: arg_value(args, "--mic"), snap, tx: tx.clone(), out, clock,
mic_on: None, sys_on: None, settle: Settle::default(),
};
diff --git a/app/native/yogurt-audio-linux/src/pulse.rs b/app/native/yogurt-audio-linux/src/pulse.rs
index b7540e46..a73dfeb1 100644
--- a/app/native/yogurt-audio-linux/src/pulse.rs
+++ b/app/native/yogurt-audio-linux/src/pulse.rs
@@ -16,7 +16,7 @@ use std::rc::Rc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::sync_channel;
use std::sync::{Arc, Mutex};
-use std::time::Duration;
+use std::time::{Duration, Instant};
#[derive(Clone, Debug, PartialEq)]
/// index: the server's number for it, new each time the device is built again (a Bluetooth profile switch)
@@ -152,7 +152,7 @@ pub const CHUNK: usize = 4800;
/// Opens a record stream on device (None: the default input, which the server moves along when the default
/// changes). on_audio gets each buffer; on_lost once if the stream breaks. None when it can't be opened.
-pub fn capture(device: Option<String>, stream_name: &'static str, on_audio: impl Fn(Vec<f32>) + Send + 'static, on_lost: impl FnOnce() + Send + 'static) -> Option<Capture> {
+pub fn capture(device: Option<String>, stream_name: &'static str, on_audio: impl Fn(Vec<f32>, Option<Instant>) + Send + 'static, on_lost: impl FnOnce() + Send + 'static) -> Option<Capture> {
let stop = Arc::new(AtomicBool::new(false));
let stop2 = stop.clone();
let (tx, rx) = sync_channel::<Result<(), String>>(1);
@@ -176,7 +176,12 @@ pub fn capture(device: Option<String>, stream_name: &'static str, on_audio: impl
return;
}
if stop2.load(Ordering::SeqCst) { break }
- on_audio(raw.chunks_exact(4).map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]])).collect());
+ let read = Instant::now();
+ // A wakeup can deliver old microphone audio buffered by the sound server.
+ let heard = if stream_name == "microphone" {
+ s.get_latency().ok().and_then(|latency| read.checked_sub(Duration::from_micros(latency.0 + 100_000)))
+ } else { None };
+ on_audio(raw.chunks_exact(4).map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]])).collect(), heard);
}
});
match rx.recv_timeout(Duration::from_secs(5)) {
diff --git a/app/native/yogurt-audio-linux/src/track.rs b/app/native/yogurt-audio-linux/src/track.rs
index c93020e4..de4b75ef 100644
--- a/app/native/yogurt-audio-linux/src/track.rs
+++ b/app/native/yogurt-audio-linux/src/track.rs
@@ -80,7 +80,7 @@ impl Track {
self.last_heard_end = Some(heard + dur);
}
if self.base_ms.is_none() {
- let ms = heard_ms.unwrap_or(arrived_ms - dur).max(0.0);
+ let ms = heard_ms.unwrap_or((self.pts as f64 / 48.0).max(arrived_ms - dur)).max(0.0);
self.base_ms = Some(ms);
self.sent_since = 0;
self.pad_to((ms * 48.0) as u64);
@@ -197,6 +197,19 @@ mod tests {
assert_eq!(crate::ogg_opus::info(&d.join("me.ogg")).unwrap().samples, 700 * 48);
}
+ #[test]
+ fn a_short_mute_keeps_the_next_pcm_on_the_saved_timeline() {
+ let d = dir();
+ let (mut t, _) = track(&d, 0, 0.0);
+ t.append(&[0.1; 4800], None, 100.0);
+ t.resync();
+ t.pad_to(150 * 48);
+ t.append(&[0.1; 4800], None, 240.0);
+ assert_eq!(t.base_ms, Some(150.0));
+ assert_eq!(t.pts, 250 * 48);
+ assert!(t.finish());
+ }
+
#[test]
fn a_gap_in_deliveries_becomes_silence() {
let d = dir();
diff --git a/app/native/yogurt-audio-win/smoke/smoke.mjs b/app/native/yogurt-audio-win/smoke/smoke.mjs
index 7a77fa0a..9d995b2e 100644
--- a/app/native/yogurt-audio-win/smoke/smoke.mjs
+++ b/app/native/yogurt-audio-win/smoke/smoke.mjs
@@ -72,7 +72,7 @@ function record(dir, ms, commands = [], args = []) {
function protocolChecks(frames, label) {
check(!frames.some((f) => f.t === 'bad' || f.t === 'torn'), `${label}: every line is JSON and every pcm payload is whole`)
- const known = new Set(['pcm', 'level', 'warn', 'mic', 'speech-off'])
+ const known = new Set(['pcm', 'level', 'warn', 'mic', 'mic-muted', 'speech-off'])
check(frames.every((f) => known.has(f.t)), `${label}: only messages the app knows`)
const codes = new Set(['no-system-audio', 'device-changed', 'no-mic', 'mic-gone'])
check(frames.filter((f) => f.t === 'warn').every((f) => codes.has(f.code)), `${label}: warnings are known codes`)
@@ -151,7 +151,10 @@ async function basic() {
const eof = spawnSync(exe, ['record', '--dir', tmp('eof')], { input: '', timeout: 15_000 })
check(eof.status === 0, 'closing stdin stops record', `${eof.status}`)
const part = tmp('part')
- await record(part, 800, [], ['--part', '2', '--start-ms', '61000'])
+ const mutedPart = await record(part, 800, [[300, 'mute 1']], ['--part', '2', '--start-ms', '61000', '--mic-muted'])
+ check(mutedPart.frames.some(f => f.t === 'mic-muted' && f.id === 1 && f.muted && f.ms >= 61000), 'replacement confirms muted on meeting time')
+ check(!mutedPart.frames.some(f => f.t === 'pcm' && f.track === 'me'), 'replacement captures no mic from launch')
+ check(existsSync(join(part, 'me.2.ogg')), 'a trailing muted interval is saved through Stop')
check(json(readFileSync(join(part, 'part.2.json'), 'utf8'))?.startMs === 61000, 'a restart notes where its part starts')
}
@@ -169,7 +172,21 @@ async function live(excluded) {
}
const dir = tmp('live')
const cmds = cable ? [[3000, `mic ${cable.uid}`], [5000, 'mic auto']] : []
+ cmds.push([5600, 'mute 1'], [6700, 'unmute 2'])
const res = await record(dir, 8000, cmds)
+ const off = res.frames.findIndex(f => f.t === 'mic-muted' && f.id === 1 && f.muted)
+ const on = res.frames.findIndex(f => f.t === 'mic-muted' && f.id === 2 && (!cable || !f.muted))
+ check(off >= 0 && on > off, 'mic commands confirm the effective state in order')
+ const interval = res.frames.slice(off + 1, on)
+ check(!interval.some(f => f.t === 'pcm' && f.track === 'me'), 'no mic PCM passes the confirmed mute')
+ if (!excluded) check(interval.some(f => f.t === 'pcm' && f.track === 'them' && f.rms > 0.02), 'call tone continues during mute')
+ if (off >= 0 && on > off && cable) {
+ const decoded = spawnSync(exe, ['decode', join(dir, 'me.ogg')])
+ const lo = Math.ceil((res.frames[off].ms + 100) * 16), hi = Math.floor((res.frames[on].ms - 100) * 16)
+ let peak = 0
+ for (let i = lo; i < hi && i * 4 < decoded.stdout.length; i++) peak = Math.max(peak, Math.abs(decoded.stdout.readFloatLE(i * 4)))
+ check(decoded.status === 0 && hi > lo && decoded.stdout.length >= hi * 4 && peak < .001, 'saved mic is silent inside the acknowledged interval')
+ }
player?.kill()
protocolChecks(res.frames, excluded ? 'excluded' : 'live')
check(res.code === 0, 'record stops cleanly', `${res.code}`)
diff --git a/app/native/yogurt-audio-win/src/main.rs b/app/native/yogurt-audio-win/src/main.rs
index 22942698..63d8538c 100644
--- a/app/native/yogurt-audio-win/src/main.rs
+++ b/app/native/yogurt-audio-win/src/main.rs
@@ -1,7 +1,7 @@
// Yogurt's recorder on Windows, speaking the same protocol as the Mac's (native/yogurt-audio/main.swift): the microphone
// (WASAPI shared mode, no communications role, so the call app keeps its mic as it was) and the computer's sound
// (the whole default output; process loopback, every app except Yogurt, on YOGURT_AUDIO_LOOPBACK=process: it missed Teams, #35).
-// yogurt-audio record --dir DIR [--part N --start-ms X] [--mic ID] [--speech LOCALE]
+// yogurt-audio record --dir DIR [--part N --start-ms X] [--mic-muted] [--mic ID] [--speech LOCALE]
// yogurt-audio join --dir DIR | inspect --dir DIR | mic-devices | speech-locales | speech-install LOCALE
// Writes DIR/me.ogg and DIR/them.ogg (Opus 20 kb/s mono, 48 kHz), a page a second so a crash keeps what was recorded.
// A restart after a crash is part N: DIR/me.N.ogg and DIR/them.N.ogg, whose file time starts at X; join stitches them.
@@ -12,6 +12,7 @@
// {"t":"warn","code":"no-system-audio"|"device-changed"|"no-mic"|"mic-gone"}
// {"t":"mic","uid":string|null,"name":string|null} the mic recording now, after each start: uid null is Auto
// {"t":"speech-off"} for --speech: Apple's speech is Mac only, Whisper gives the live words
+// mute ID and unmute ID reply with {"t":"mic-muted","id":ID,"muted":bool,"ms":meeting time}.
// stdin: pause, resume, stop (end of input also stops), mic ID or mic auto (switch without stopping). Problems go to stderr.
mod gap;
mod join;
@@ -103,7 +104,7 @@ fn record(args: &[String], dir: &Path) {
}
#[cfg(windows)]
{
- let o = record::Options { part, start_ms, mic: arg_value(args, "--mic"), speech: arg_value(args, "--speech").is_some() };
+ let o = record::Options { part, start_ms, mic_muted: args.iter().any(|a| a == "--mic-muted"), mic: arg_value(args, "--mic"), speech: arg_value(args, "--speech").is_some() };
std::process::exit(record::run(dir, o));
}
#[cfg(not(windows))]
diff --git a/app/native/yogurt-audio-win/src/record.rs b/app/native/yogurt-audio-win/src/record.rs
index 3f3f4075..c9483b0c 100644
--- a/app/native/yogurt-audio-win/src/record.rs
+++ b/app/native/yogurt-audio-win/src/record.rs
@@ -15,6 +15,7 @@ pub struct Options {
pub part: u32,
pub start_ms: f64,
pub mic: Option<String>,
+ pub mic_muted: bool,
pub speech: bool,
}
@@ -24,6 +25,10 @@ struct Recorder {
mic: Option<Stream>,
sys: Option<Stream>,
paused: bool,
+ mic_muted: bool,
+ mic_generation: u64,
+ mic_from: Option<f64>,
+ start_ms: f64,
/// the microphone the person chose (its ID); None is Auto, Windows' default input, followed as it changes
mic_uid: Option<String>,
mic_rebuild: Option<Instant>,
@@ -42,6 +47,10 @@ pub fn run(dir: &Path, o: Options) -> i32 {
mic: None,
sys: None,
paused: false,
+ mic_muted: o.mic_muted,
+ mic_generation: 0,
+ mic_from: None,
+ start_ms: o.start_ms,
mic_uid: o.mic,
mic_rebuild: None,
sys_rebuild: None,
@@ -79,9 +88,16 @@ pub fn run(dir: &Path, o: Options) -> i32 {
due = due.min(d);
}
match rx.recv_timeout(due.saturating_duration_since(now)) {
- Ok(Ev::Mic(b)) => {
- if !r.paused {
- r.me.append(&b, None, r.clock.now_ms())
+ Ok(Ev::Mic(b, generation, heard)) => {
+ if !r.paused && !r.mic_muted && generation == r.mic_generation {
+ let skip = match (r.mic_from, heard) {
+ (Some(from), Some(at)) => ((from - at) * 48.0).ceil() as usize,
+ (Some(_), None) => b.len(),
+ (None, _) => 0,
+ };
+ if skip < b.len() {
+ r.me.append(&b[skip..], None, r.clock.now_ms())
+ }
}
}
Ok(Ev::Sys(b, heard)) => {
@@ -89,7 +105,7 @@ pub fn run(dir: &Path, o: Options) -> i32 {
r.them.append(&b, Some(heard), r.clock.now_ms())
}
}
- Ok(Ev::MicLost) => r.schedule_mic(SETTLE),
+ Ok(Ev::MicLost(generation)) => { if generation == r.mic_generation { r.mic.take(); r.schedule_mic(SETTLE) } }
Ok(Ev::SysLost) => r.sys_rebuild = Some(Instant::now() + SETTLE),
Ok(Ev::Default(true)) => r.sys_rebuild = Some(Instant::now() + SETTLE),
// Auto follows Windows' input; a chosen mic stays put
@@ -128,6 +144,7 @@ pub fn run(dir: &Path, o: Options) -> i32 {
}
if now >= next_level {
next_level = now + tick;
+ if r.mic_muted && !r.paused { r.me.pad_to((r.clock.now_ms() * 48.0) as i64); }
let (me, them) = if r.paused { (0.0, 0.0) } else { (r.me.level(), r.them.level()) };
out::level(me, them);
}
@@ -158,7 +175,8 @@ impl Recorder {
/// The chosen mic, else the default; false when neither records. gone: tell the picker when the chosen one failed
fn start_mic(&mut self, gone: bool) -> bool {
- match win::start_mic(self.mic_uid.clone(), self.tx.clone()) {
+ self.mic_generation += 1;
+ match win::start_mic(self.mic_uid.clone(), self.tx.clone(), self.mic_generation, self.clock) {
Ok(s) => {
self.mic = Some(s);
return true;
@@ -176,7 +194,7 @@ impl Recorder {
if gone {
out::warn("mic-gone");
}
- if let Ok(s) = win::start_mic(None, self.tx.clone()) {
+ if let Ok(s) = win::start_mic(None, self.tx.clone(), self.mic_generation, self.clock) {
self.mic = Some(s);
return true;
}
@@ -277,6 +295,22 @@ impl Recorder {
self.me.resync();
self.them.resync();
}
+ _ if c.starts_with("mute ") || c.starts_with("unmute ") => {
+ let Some((action, id)) = c.split_once(' ') else { return false };
+ let Ok(id) = id.parse::<u32>() else { return false };
+ let off = action == "mute";
+ let boundary = (self.start_ms + self.clock.now_ms().max(self.me.pts as f64 / 48.0)).ceil() - self.start_ms;
+ let changing = off != self.mic_muted;
+ if changing {
+ self.me.resync();
+ self.me.level();
+ self.mic_muted = off || self.mic.is_none();
+ if !self.mic_muted { self.mic_from = Some(boundary); }
+ if !off && self.mic.is_none() { self.schedule_mic(SETTLE); }
+ }
+ out::send(&format!(r#"{{"t":"mic-muted","id":{id},"muted":{},"ms":{}}}"#, self.mic_muted, (self.start_ms + boundary).ceil()), None);
+ if changing { self.me.pad_to((boundary * 48.0).ceil() as i64); }
+ }
"stop" => return true,
_ if c.starts_with("mic ") => self.choose_mic(c[4..].trim()),
_ => log(&format!("unknown command: {c}")),
@@ -285,6 +319,7 @@ impl Recorder {
}
fn finish(&mut self) {
+ if self.mic_muted { self.me.pad_to((self.clock.now_ms() * 48.0) as i64); }
if let Some(s) = self.mic.take() {
s.stop();
}
diff --git a/app/native/yogurt-audio-win/src/track.rs b/app/native/yogurt-audio-win/src/track.rs
index de3ec4bd..f2ba6a6f 100644
--- a/app/native/yogurt-audio-win/src/track.rs
+++ b/app/native/yogurt-audio-win/src/track.rs
@@ -92,7 +92,7 @@ impl Track {
self.last_heard_end = Some(heard + dur);
}
if self.base_ms.is_none() {
- let ms = heard_ms.unwrap_or(now_ms - dur).max(0.0);
+ let ms = heard_ms.unwrap_or((self.pts as f64 / 48.0).max(now_ms - dur)).max(0.0);
self.base_ms = Some(ms);
self.sent_since = 0;
// file time is meeting time: startup, pauses and device rebuilds become silence
@@ -215,6 +215,19 @@ mod tests {
assert_eq!(i.duration_ms, 600.0);
}
+ #[test]
+ fn a_short_mute_keeps_the_next_pcm_on_the_saved_timeline() {
+ let dir = crate::testdir("track-short-mute");
+ let mut t = track(&dir);
+ t.append(&[0.1; 4800], None, 100.0);
+ t.resync();
+ t.pad_to(150 * 48);
+ t.append(&[0.1; 4800], None, 240.0);
+ assert_eq!(t.base_ms, Some(150.0));
+ assert_eq!(t.pts, 250 * 48);
+ assert!(t.finish());
+ }
+
#[test]
fn a_gap_of_more_than_250_ms_is_silence_in_the_file() {
let dir = crate::testdir("track-gap");
diff --git a/app/native/yogurt-audio-win/src/win/mod.rs b/app/native/yogurt-audio-win/src/win/mod.rs
index 48848aa5..3e45534e 100644
--- a/app/native/yogurt-audio-win/src/win/mod.rs
+++ b/app/native/yogurt-audio-win/src/win/mod.rs
@@ -22,8 +22,8 @@ use crate::out::log;
/// What the capture threads and Windows tell the recorder
pub enum Ev {
- Mic(Vec<f32>),
- MicLost,
+ Mic(Vec<f32>, u64, Option<f64>),
+ MicLost(u64),
/// the computer's sound and the meeting time it was heard at
Sys(Vec<f32>, f64),
SysLost,
@@ -317,7 +317,7 @@ fn spawn(
}
/// The microphone: the one with this ID, or Windows' default input
-pub fn start_mic(uid: Option<String>, tx: Sender<Ev>) -> Result<Stream, StartError> {
+pub fn start_mic(uid: Option<String>, tx: Sender<Ev>, generation: u64, clock: Clock) -> Result<Stream, StartError> {
let lost_tx = tx.clone();
spawn(
move || {
@@ -331,12 +331,13 @@ pub fn start_mic(uid: Option<String>, tx: Sender<Ev>) -> Result<Stream, StartErr
Ok((client, ch, false))
},
move |p| {
- if let Some((s, _)) = p {
- let _ = tx.send(Ev::Mic(s));
+ if let Some((s, qpc)) = p {
+ let heard = (qpc != 0).then(|| clock.qpc_ms(qpc));
+ let _ = tx.send(Ev::Mic(s, generation, heard));
}
},
move || {
- let _ = lost_tx.send(Ev::MicLost);
+ let _ = lost_tx.send(Ev::MicLost(generation));
},
)
}
diff --git a/app/native/yogurt-audio/main.swift b/app/native/yogurt-audio/main.swift
index a7ff8d4a..2c584313 100644
--- a/app/native/yogurt-audio/main.swift
+++ b/app/native/yogurt-audio/main.swift
@@ -1,7 +1,7 @@
// Yogurt's recorder: the microphone (AVAudioEngine, shared with the call app: no voice processing, which silenced
// Zoom's mic) and the computer's sound (a Core Audio process tap on every process except Yogurt,
// macOS 14.2+; the audio-capture permission needs 14.4). Yogurt never joins the call.
-// yogurt-audio record --dir DIR [--part N --start-ms X] [--mic UID]
+// yogurt-audio record --dir DIR [--part N --start-ms X] [--mic-muted] [--mic UID]
// yogurt-audio join --dir DIR
// A restart after a crash is part N (N >= 1) and carries on at meeting time X: it writes DIR/me.N.m4a and DIR/them.N.m4a,
// whose file time starts at X, and its pcm ms continue from X. Existing parts are never deleted.
@@ -16,6 +16,7 @@
// {"t":"mic","uid":string|null,"name":string|null} the mic recording now, after each start: uid null is Auto (the Mac's default input)
// {"t":"speech","track":"me"|"them","final":bool,"startMs","endMs","text","words":[{"text","startMs","endMs"}]} Apple's on-device speech (record --speech LOCALE, macOS 26)
// yogurt-audio speech-locales → {"available","supported":[bcp47],"installed":[bcp47]}; speech-install LOCALE → {"installed":bool}
+// mute ID and unmute ID reply with {"t":"mic-muted","id":ID,"muted":bool,"ms":meeting time}.
// stdin: pause, resume, stop (end of input also stops), mic UID or mic auto (switch without stopping). Problems go to stderr.
import AVFoundation
import Speech
@@ -34,12 +35,11 @@ func fail(_ s: String) -> Never { log(s); exit(1) }
let outQ = DispatchQueue(label: "yogurt.out")
/// all audio work runs here, so tracks, pause and rebuilds never race
let work = DispatchQueue(label: "yogurt.work")
-let started = Date()
let args = CommandLine.arguments
/// this run's part of the meeting's files (0: the first) and the meeting time it starts at
let part = Int(args.firstIndex(of: "--part").flatMap { $0 + 1 < args.count ? args[$0 + 1] : nil } ?? "0") ?? 0
let startOffsetMs = Double(args.firstIndex(of: "--start-ms").flatMap { $0 + 1 < args.count ? args[$0 + 1] : nil } ?? "0") ?? 0
-func nowMs() -> Double { Date().timeIntervalSince(started) * 1000 }
+func nowMs() -> Double { hostMs(mach_absolute_time()) }
/// a Core Audio host time on the same clock as nowMs
let startedHost = mach_absolute_time()
let hostMsPerTick: Double = { var tb = mach_timebase_info_data_t(); mach_timebase_info(&tb); return Double(tb.numer) / Double(tb.denom) / 1e6 }()
@@ -168,7 +168,8 @@ final class Track {
conv48 = AVAudioConverter(from: buf.format, to: mono48)
}
if baseMs == nil {
- let ms = max(0, heardMs ?? (nowMs() - Double(buf.frameLength) / buf.format.sampleRate * 1000))
+ let estimated = nowMs() - Double(buf.frameLength) / buf.format.sampleRate * 1000
+ let ms = max(0, heardMs ?? max(Double(pts) / 48, estimated))
baseMs = ms; sentSince = 0
// file time is meeting time: startup, pauses and device rebuilds become silence, so both files line up with pcm ms
padTo(Int64(ms * 48))
@@ -443,12 +444,14 @@ final class SystemAudio {
final class Mic {
var engine: AVAudioEngine?
+ private var generation = 0
/// the microphone to record from; nil: the Mac's default input
var device: AudioObjectID?
- let onBuffer: (AVAudioPCMBuffer) -> Void
- init(onBuffer: @escaping (AVAudioPCMBuffer) -> Void) { self.onBuffer = onBuffer }
+ let onBuffer: (AVAudioPCMBuffer, Double?) -> Void
+ init(onBuffer: @escaping (AVAudioPCMBuffer, Double?) -> Void) { self.onBuffer = onBuffer }
func start() -> Bool {
+ guard AVCaptureDevice.authorizationStatus(for: .audio) == .authorized else { return false }
let e = AVAudioEngine()
let input = e.inputNode
// No voice processing: with it on, the call app on the same mic (Zoom) got near silence until Yogurt stopped.
@@ -494,10 +497,13 @@ final class Mic {
// recorder (issue #27). nil takes the bus's format as it is, and each buffer says its own rate.
let fmt = input.inputFormat(forBus: 0)
guard fmt.sampleRate > 0, fmt.channelCount > 0 else { log("no microphone"); return false }
+ generation += 1
+ let current = generation
let onBuffer = self.onBuffer
- input.installTap(onBus: 0, bufferSize: AVAudioFrameCount(fmt.sampleRate / 10), format: nil) { b, _ in
+ input.installTap(onBus: 0, bufferSize: AVAudioFrameCount(fmt.sampleRate / 10), format: nil) { b, at in
+ let heard = at.isHostTimeValid ? hostMs(at.hostTime) : nil
guard let m = mono(b, firstOnly: true) else { return }
- work.async { onBuffer(m) }
+ work.async { if self.generation == current { onBuffer(m, heard) } }
}
return true
}
@@ -527,6 +533,7 @@ final class Mic {
}
func stop() {
+ generation += 1
guard let e = engine else { return }
e.inputNode.removeTap(onBus: 0)
e.stop()
@@ -672,6 +679,8 @@ let testing = ProcessInfo.processInfo.environment["YOGURT_AUDIO_TEST"] == "1"
final class Recorder {
let me: Track, them: Track
var mic: Mic!, sys: SystemAudio!
+ var micMuted = args.contains("--mic-muted")
+ var micFrom: Double?
var paused = false, finishing = false, sysAllowed = true
var timer: DispatchSourceTimer?
var micRebuild: DispatchWorkItem?, sysRebuild: DispatchWorkItem?
@@ -681,34 +690,52 @@ final class Recorder {
var micUID: String? = argValue("--mic")
/// Apple's live speech per track (macOS 26, when asked for with --speech), as Any so older Macs never see the type
var speech: [String: Any] = [:]
+ var micSpeechGeneration = 0
init(dir: URL) {
me = Track("me", dir: dir); them = Track("them", dir: dir)
- mic = Mic { [unowned self] b in if !self.paused && !self.finishing { self.me.append(b) } }
+ mic = Mic { [unowned self] b, heard in
+ guard !self.paused, !self.finishing, !self.micMuted else { return }
+ // A late or straddling tap can still contain samples captured before unmute.
+ if let from = self.micFrom {
+ guard let heard, let data = b.floatChannelData?[0] else { return }
+ let skip = max(0, Int(ceil((from - heard) * b.format.sampleRate / 1000)))
+ let keep = Int(b.frameLength) - skip
+ guard keep > 0 else { return }
+ if skip > 0 {
+ memmove(data, data + skip, keep * MemoryLayout<Float>.size)
+ b.frameLength = AVAudioFrameCount(keep)
+ }
+ }
+ self.me.append(b)
+ }
sys = SystemAudio { [unowned self] b, heard in if !self.paused && !self.finishing { self.them.append(b, heardMs: heard) } }
sys.onRateChange = { [unowned self] in self.rebuildSystem() }
}
/// Apple's speech on both tracks, in the locale asked for; words come out as speech frames beside the pcm
- func startSpeech(_ wanted: String) {
+ func startSpeech(_ wanted: String, micOnly: Bool = false) {
#if compiler(>=6.2)
guard #available(macOS 26, *) else { log("speech: needs macOS 26"); send(["t": "speech-off"]); return }
+ let tracks = micOnly ? [me] : micMuted ? [them] : [me, them]
+ let generation = micSpeechGeneration
Task {
- guard let locale = speechLocale(wanted, in: await SpeechTranscriber.installedLocales) else { log("speech: \(wanted) is not installed"); send(["t": "speech-off"]); return }
- var started = 0
- for track in [me, them] {
+ guard let locale = speechLocale(wanted, in: await SpeechTranscriber.installedLocales) else { log("speech: \(wanted) is not installed"); if !micOnly { send(["t": "speech-off"]) }; return }
+ for track in tracks {
let live = LiveSpeech(track: track.name, locale: locale)
guard await live.start() else { continue }
- started += 1
- work.async { [unowned self] in
+ work.async {
+ if self.finishing || (track === self.me && generation != self.micSpeechGeneration) {
+ Task { await live.finish() }; return
+ }
self.speech[track.name] = live
- track.onPcm16 = { b, ms in live.feed(b, atMs: ms) }
+ track.onPcm16 = { b, ms in live.feed(b, atMs: startOffsetMs + ms) }
}
}
// one track without it is better than none; none at all means whisper's own readings take over
- if started == 0 { send(["t": "speech-off"]) } else {
- log("speech: listening in \(locale.identifier(.bcp47))")
- work.async { [unowned self] in send(["t": "speech-ready", "tracks": Array(self.speech.keys).sorted()]) }
+ work.async {
+ if self.speech.isEmpty && !micOnly { send(["t": "speech-off"]) }
+ else { send(["t": "speech-ready", "tracks": Array(self.speech.keys).sorted()]) }
}
}
#else
@@ -732,7 +759,8 @@ final class Recorder {
t.schedule(deadline: .now() + 0.1, repeating: 0.1)
t.setEventHandler { [unowned self] in
if self.finishing { return }
- send(["t": "level", "me": self.paused ? 0 : self.me.level(), "them": self.paused ? 0 : self.them.level()])
+ if self.micMuted && !self.paused { self.me.padTo(Int64(nowMs() * 48)) }
+ send(["t": "level", "me": self.paused || self.micMuted ? 0 : self.me.level(), "them": self.paused ? 0 : self.them.level()])
}
t.resume(); timer = t
@@ -844,10 +872,41 @@ final class Recorder {
rebuildMic(after: 0)
}
+ func setMicMuted(_ off: Bool, id: Int, inputReady: @autoclosure () -> Bool) {
+ let boundary = ceil(startOffsetMs + max(nowMs(), Double(me.pts) / 48)) - startOffsetMs
+ let changing = off != micMuted
+ if changing {
+ me.resync()
+ me.srcRate = 0
+ _ = me.level()
+ if off {
+ micMuted = true
+ micSpeechGeneration += 1
+ me.onPcm16 = nil
+ #if compiler(>=6.2)
+ if #available(macOS 26, *), let live = speech.removeValue(forKey: "me") as? LiveSpeech {
+ Task { await live.finish() }
+ }
+ #endif
+ } else {
+ micMuted = !inputReady()
+ if !micMuted { micFrom = boundary }
+ if !micMuted, let wanted = argValue("--speech") { startSpeech(wanted, micOnly: true) }
+ }
+ }
+ send(["t": "mic-muted", "id": id, "muted": micMuted, "ms": startOffsetMs + boundary])
+ if changing { me.padTo(Int64(ceil(boundary * 48))) }
+ }
+
func command(_ c: String) {
switch c {
case "pause": paused = true; me.flushPending(); them.flushPending()
case "resume": paused = false; me.resync(); them.resync()
+ case _ where c.hasPrefix("mute ") || c.hasPrefix("unmute "):
+ let fields = c.split(separator: " ")
+ guard fields.count == 2, let id = Int(fields[1]) else { return }
+ setMicMuted(fields[0] == "mute", id: id,
+ inputReady: mic.engine?.isRunning == true && AVCaptureDevice.authorizationStatus(for: .audio) == .authorized)
case "stop": finish()
case _ where c.hasPrefix("mic "): chooseMic(String(c.dropFirst(4)).trimmingCharacters(in: .whitespaces))
// local measurements only (YOGURT_AUDIO_TEST=1): the engine stopped as a configuration change stops it, then
@@ -862,6 +921,7 @@ final class Recorder {
if finishing { return }
finishing = true
timer?.cancel()
+ if micMuted { me.padTo(Int64(nowMs() * 48)) }
mic.stop(); sys.stop()
me.flushPending(); them.flushPending()
// both files end together, so they stay the same length
@@ -1247,7 +1307,7 @@ if part > 0 {
}
switch AVCaptureDevice.authorizationStatus(for: .audio) {
-case .notDetermined:
+case .notDetermined where !args.contains("--mic-muted"):
let s = DispatchSemaphore(value: 0)
var ok = false
AVCaptureDevice.requestAccess(for: .audio) { ok = $0; s.signal() }
diff --git a/app/src/main/asr/chunker.ts b/app/src/main/asr/chunker.ts
index 08e2f11b..c8c493c7 100644
--- a/app/src/main/asr/chunker.ts
+++ b/app/src/main/asr/chunker.ts
@@ -142,6 +142,8 @@ export function chunker(onChunk: (c: Chunk) => void, onPartial?: (c: Chunk) => v
/** ms is meeting time of samples[0]; frames may be any size */
push(track: Track, ms: number, samples: Float32Array) {
const st = tracks[track]
+ // A recorder boundary ends only this input, even for a mute shorter than GAP_MS.
+ if (!samples.length) { flushTrack(track); return }
if (st.next !== null && Math.abs(ms - st.next) > GAP_MS) flushTrack(track)
if (st.next === null) { st.winStart = ms; st.rest = new Float32Array(0) }
st.next = ms + samples.length / 16
diff --git a/app/src/main/asr/index.ts b/app/src/main/asr/index.ts
index 6679ed9a..f411743a 100644
--- a/app/src/main/asr/index.ts
+++ b/app/src/main/asr/index.ts
@@ -16,6 +16,7 @@ import { createTranscriber, type Line, type Transcribe } from './transcribe'
import { meetingWords, respell, whisperPrompt } from '../vocab'
import type { TranscriptPartial } from '../../shared/types'
import type { Chunk } from './chunker'
+import { MicInput } from './micInput'
/**
* Live transcription of the meeting being recorded: the capture's audio goes through a pipeline (chunks, whisper-server,
@@ -30,8 +31,9 @@ type Session = { complete?: () => boolean; pipeline: Pipeline | null; priorLines
replacement?: boolean
/** Apple's speech listens in this locale for the meeting (null: whisper only); off once whisper hears another language */
speech?: string | null
+ micQuickAfterFinal?: boolean
/** Live input only: saved-file transcription must never influence call detection. */
- live?: { quietSince: number; frames: Partial<Record<Track, number>> } }
+ live?: { quietSince: number; mic: MicInput; micFrom?: number; frames: Partial<Record<Track, number>> } }
/**
* The saved transcript comes from whisper; Apple's words are the live view. Languages listed here are the ones where Apple's
@@ -42,12 +44,21 @@ export const APPLE_FINALS_LANGUAGES: ReadonlySet<string> = new Set<string>()
/** seconds of someone talking with no word from Apple's speech before whisper's own readings take over (its first words can take a while to warm up) */
const SPEECH_WATCH_POLLS = 15
+/** Switching live readers clears its words, so give the pre-mute final the first turn. */
+function micQuickReads(s: Session, on: boolean) {
+ const words = s.pipeline?.partials().find(part => part.track === 'me')?.words ?? []
+ if (words.some(word => word.muteMs !== undefined)) { s.micQuickAfterFinal = on; return }
+ delete s.micQuickAfterFinal
+ s.pipeline?.setQuickReads(on, 'me')
+}
+
/** Apple's speech is set aside for the rest of this meeting: whisper's quick readings come back */
function speechOff(s: Session, why: string) {
if (!s.speech) return
console.log(`speech: ${why}: Apple's words are set aside for this meeting`)
s.speech = null
- s.pipeline?.setQuickReads(true)
+ s.pipeline?.setQuickReads(true, 'them')
+ micQuickReads(s, true)
}
/** what the Mac's speech can do, read once at start-up (nothing where it is not available) */
@@ -98,7 +109,8 @@ const sessions = new Map<string, Session>()
export function liveSilentMs(id: string, now = Date.now()): number {
const s = sessions.get(id), live = s?.live
if (!s?.pipeline || !live || recordingPaused(id)) return 0
- if (['me', 'them'].some(track => now - (live.frames[track as Track] ?? -Infinity) > 3000)) return 0
+ const tracks: Track[] = live.micFrom === Infinity ? ['them'] : ['me', 'them']
+ if (tracks.some(track => now - (live.frames[track] ?? -Infinity) > 3000)) return 0
return Math.max(0, now - live.quietSince)
}
@@ -240,6 +252,19 @@ export function hookTranscription(p: {
setTimeout(() => warnOnce('no-speech-model'), NO_MODEL_NOTE_DELAY_MS)
}
}
+ if (transcribe && !later) {
+ const read = transcribe
+ transcribe = async (chunk, opts) => {
+ if (chunk.track !== 'me' || !s.live) return read(chunk, opts)
+ const lines: Line[] = []
+ for (const clip of s.live.mic.audible(chunk)) {
+ if (opts?.partial && clip.startMs < (s.live.micFrom ?? 0)) continue
+ const result = await read(clip, opts)
+ if (!opts?.partial || clip.startMs >= (s.live.micFrom ?? 0)) lines.push(...result)
+ }
+ return lines
+ }
+ }
if (transcribe && options) {
const read = transcribe
transcribe = async (chunk, opts) => {
@@ -264,6 +289,7 @@ export function hookTranscription(p: {
}, emitPartial: options?.save || !p.sendPartial ? undefined : part => {
if (s.live && part.text.trim()) s.live.quietSince = Date.now()
p.sendPartial?.(part)
+ if (part.track === 'me' && s.micQuickAfterFinal !== undefined && !part.words?.length) micQuickReads(s, s.micQuickAfterFinal)
}, holdMs: p.holdMs, extraWaitMs: p.extraWaitMs, onWarn: warnOnce,
nameOf: (a, b) => p.store.meeting?.(id)?.source === 'audio-file' ? AUDIO_SPEAKER : p.nameOf?.(id, a, b) ?? previousSpeaker(priorSegments,'them',a,b),
respell: (t) => { const m = p.store.meeting?.(id); return m ? respell(t, meetingWords(m)) : t } }) : null,
@@ -291,28 +317,54 @@ export function hookTranscription(p: {
// each capture of a meeting (a restarted recorder is a new one) feeds that meeting's session
const offCapture = onCaptureStart((c, meetingId) => {
const s = open(meetingId)
- s.live = { quietSince: Date.now(), frames: {} }
+ const live: NonNullable<Session['live']> = { quietSince: Date.now(), mic: s.live?.mic ?? new MicInput(), micFrom: s.live?.micFrom, frames: {} }
+ s.live = live
+ const silence = (ms: number, samples: Float32Array) => s.pipeline?.push('me', ms, samples)
+ c.on('level', () => { if (s.live === live) live.mic.tick(silence) })
+ let appleMic = !!s.speech, appleCall = !!s.speech
+ c.on('mic-boundary', ({ muted, ms }) => {
+ if (s.live !== live) return
+ live.micFrom = muted ? Infinity : ms
+ live.quietSince = Date.now()
+ live.mic.boundary(muted, ms, silence)
+ if (muted) {
+ const part = s.pipeline?.partials().find(part => part.track === 'me')
+ if (part?.words?.length) {
+ for (const word of part.words) word.muteMs ??= ms
+ try { p.sendPartial?.(part) } catch (error) { console.error('sending held mic words failed', error) }
+ }
+ }
+ })
c.on('pcm', (track, ms, samples) => {
- if (!samples.length) return
+ if (s.live !== live || !samples.length || (track === 'me' && ms < (live.micFrom ?? 0))) return
s.pipeline?.push(track, ms, samples)
- const now = Date.now(), live = s.live!
+ const now = Date.now()
// A gap, restart or pause must earn a new quiet minute, not count missing audio as silence.
if (now - (live.frames[track] ?? -Infinity) > 3000 || recordingPaused(meetingId) || s.pipeline?.talking('me') || s.pipeline?.talking('them')) live.quietSince = now
live.frames[track] = now
})
// Apple's speech that never speaks up: the helper says so, or someone has talked for a while with no word from it
- c.on('speech-off', () => speechOff(s, 'the helper could not run it'))
+ c.on('speech-off', () => { if (s.live === live) speechOff(s, 'the helper could not run it') })
// Apple listening on one track only: whisper's own quick readings cover the other
- c.on('speech-ready', (tracks) => { if (!s.speech || !s.pipeline) return; for (const t of ['me', 'them'] as const) if (!tracks.includes(t)) s.pipeline.setQuickReads(true, t) })
+ c.on('speech-ready', (tracks) => {
+ if (s.live !== live || !s.speech || !s.pipeline) return
+ const heardMic = tracks.includes('me')
+ if (heardMic !== appleMic) micQuickReads(s, !heardMic)
+ appleMic = heardMic
+ const heardCall = tracks.includes('them')
+ if (heardCall !== appleCall) s.pipeline.setQuickReads(!heardCall, 'them')
+ appleCall = heardCall
+ })
let heardSpeech = false, talkedPolls = 0
const watch = setInterval(() => {
if (!s.speech || heardSpeech || !s.pipeline) { clearInterval(watch); return }
if (s.pipeline.talking('me') || s.pipeline.talking('them')) talkedPolls++
if (talkedPolls >= SPEECH_WATCH_POLLS) { clearInterval(watch); speechOff(s, 'no words came while people talked') }
}, 1000)
- c.on('ended', () => { clearInterval(watch); if (s.live) s.live.frames = {} })
+ c.on('ended', () => { clearInterval(watch); live.frames = {} })
// Apple's words: the live view (whisper's line replaces them), or the saved line too where Apple measured as good
c.on('speech', (f) => {
+ if (s.live !== live || (f.track === 'me' && f.startMs < (live.micFrom ?? 0))) return
heardSpeech = true
if (s.live && f.text.trim()) s.live.quietSince = Date.now()
if (!s.speech || !s.pipeline) return
diff --git a/app/src/main/asr/micInput.ts b/app/src/main/asr/micInput.ts
new file mode 100644
index 00000000..1a935596
--- /dev/null
+++ b/app/src/main/asr/micInput.ts
@@ -0,0 +1,58 @@
+import type { Chunk } from './chunker'
+
+/** Confirmed silent intervals on the capture clock. The helper stops sending mic PCM while muted. */
+export class MicInput {
+ private mutes: { start: number; end: number }[] = []
+ private sentUntil = 0
+ private wallStart = 0
+
+ boundary(muted: boolean, ms: number, silence: (ms: number, samples: Float32Array) => void) {
+ const last = this.mutes.at(-1)
+ if (last?.end === Infinity) {
+ if (muted) return
+ this.advance(ms, silence)
+ last.end = ms
+ } else if (muted) {
+ this.mutes.push({ start: ms, end: Infinity })
+ this.sentUntil = ms
+ this.wallStart = performance.now()
+ }
+ }
+
+ tick(silence: (ms: number, samples: Float32Array) => void) {
+ const last = this.mutes.at(-1)
+ if (last?.end === Infinity) this.advance(last.start + Math.floor(performance.now() - this.wallStart), silence)
+ }
+
+ private advance(ms: number, silence: (ms: number, samples: Float32Array) => void) {
+ // One second of quiet ends the utterance, plus the echo canceller's reference wait and a chunker window.
+ const until = Math.min(ms, this.mutes.at(-1)!.start + 3000)
+ const count = Math.floor((until - this.sentUntil) * 16)
+ if (count <= 0) return
+ silence(this.sentUntil, new Float32Array(count))
+ this.sentUntil += count / 16
+ }
+
+ /** A rapid unmute can fall within one speech chunk. Whisper reads each audible stretch on its original clock. */
+ audible(chunk: Chunk): Chunk[] {
+ if ((this.mutes.at(-1)?.end ?? -Infinity) <= chunk.startMs) return [chunk]
+ const end = chunk.startMs + chunk.samples.length / 16
+ let from = chunk.startMs
+ const pieces: Chunk[] = []
+ const add = (a: number, b: number) => {
+ if (b <= a) return
+ const samples = chunk.samples.subarray(Math.round((a - chunk.startMs) * 16), Math.round((b - chunk.startMs) * 16))
+ const clearMs = chunk.clearMs === undefined ? undefined : Math.min(b - a, chunk.clearMs)
+ pieces.push({ ...chunk, startMs: a, samples, clearMs })
+ }
+ for (const mute of this.mutes) {
+ if (mute.end <= from) continue
+ if (mute.start >= end) break
+ add(from, mute.start)
+ from = Math.max(from, mute.end)
+ }
+ if (from === chunk.startMs && !pieces.length) return [chunk]
+ add(from, end)
+ return pieces
+ }
+}
diff --git a/app/src/main/capture.ts b/app/src/main/capture.ts
index c7f4ab3f..c998ce70 100644
--- a/app/src/main/capture.ts
+++ b/app/src/main/capture.ts
@@ -8,6 +8,7 @@ import { fakeAudioDuration, fakeCaptureProc, joinFakeParts } from './fakeCapture
import type { RecordingStart } from './meeting'
import { createCrashPolicy } from './crashPolicy'
import { createLevelLog } from './levelLog'
+import { micIsOff, type MicState } from '../shared/types'
import { helperFile } from '../shared/platform'
/**
@@ -31,7 +32,9 @@ export type Level = { me: number; them: number }
export type SpeechFrame = { t: 'speech'; track: Track; final: boolean; startMs: number; endMs: number; text: string
/** each word's time (a volatile reading is one run for all its words) */
words?: Array<{ text: string; startMs: number; endMs: number }> }
+type MicAck = { t: 'mic-muted'; id: number; muted: boolean; ms: number }
export type Frame =
+ | MicAck
| { t: 'pcm'; track: Track; ms: number; samples: Float32Array }
| ({ t: 'level' } & Level)
| { t: 'warn'; code: WarnCode }
@@ -88,6 +91,8 @@ function readLine(line: string): Header | null {
try { m = JSON.parse(line) } catch { console.error('capture: unreadable line', line.slice(0, 200)); return null }
if (m.t === 'pcm' && (m.track === 'me' || m.track === 'them') && Number.isInteger(m.n) && (m.n as number) >= 0)
return { t: 'pcm', track: m.track, ms: Number(m.ms), n: m.n as number }
+ if (m.t === 'mic-muted' && typeof m.id === 'number' && Number.isSafeInteger(m.id) && m.id > 0 && typeof m.muted === 'boolean' && typeof m.ms === 'number' && Number.isFinite(m.ms) && m.ms >= 0)
+ return { t: 'mic-muted', id: m.id, muted: m.muted, ms: m.ms }
if (m.t === 'level') return { t: 'level', me: Number(m.me) || 0, them: Number(m.them) || 0 }
if (m.t === 'warn' && typeof m.code === 'string' && WARN_CODES.includes(m.code)) return { t: 'warn', code: m.code as WarnCode }
if (m.t === 'speech-off') return { t: 'speech-off' }
@@ -108,6 +113,8 @@ export interface CaptureProc {
}
export interface Capture {
+ on(e: 'mic-muted', fn: (ack: MicAck) => void): this
+ on(e: 'mic-boundary', fn: (ack: MicAck) => void): this
on(e: 'pcm', fn: (track: Track, ms: number, samples: Float32Array) => void): this
on(e: 'level', fn: (lv: Level) => void): this
on(e: 'warn', fn: (code: WarnCode) => void): this
@@ -136,6 +143,7 @@ export class Capture extends EventEmitter {
else if (f.t === 'speech') this.emit('speech', f)
else if (f.t === 'speech-off') this.emit('speech-off')
else if (f.t === 'speech-ready') this.emit('speech-ready', f.tracks)
+ else if (f.t === 'mic-muted') { if (!this.exited) this.emit('mic-muted', f) }
else if (f.t === 'mic') this.emit('mic', { uid: f.uid, name: f.name })
else this.emit('warn', f.code)
}
@@ -159,6 +167,7 @@ export class Capture extends EventEmitter {
if (this.exited || this.proc.stdin.destroyed || !this.proc.stdin.writable) return false
try { this.proc.stdin.write(cmd + '\n'); return true } catch { return false }
}
+ setMicMuted(muted: boolean, request: number) { return !this.stopping && this.send((muted ? 'mute ' : 'unmute ') + request) }
pause() { return !this.stopping && this.send('pause') }
resume() { return !this.stopping && this.send('resume') }
/** records from this mic from now on (null: Auto), without stopping */
@@ -193,13 +202,13 @@ function speechWords(x: unknown): { words?: SpeechFrame['words'] } {
}
/** A restart is the next part of the same meeting's files, starting at meeting time startMs; speech: Apple's live words in this locale; mic: the chosen mic's UID (none: Auto) */
-export type CaptureOpts = { part?: number; startMs?: number; speech?: string | null; mic?: string | null }
+export type CaptureOpts = { part?: number; startMs?: number; speech?: string | null; mic?: string | null; micMuted?: boolean }
export const captureArgs = (dir: string, o?: CaptureOpts): string[] =>
- ['record', '--dir', dir, ...(o?.part ? ['--part', String(o.part), '--start-ms', String(Math.round(o.startMs ?? 0))] : []), ...(o?.speech ? ['--speech', o.speech] : []), ...(o?.mic ? ['--mic', o.mic] : [])]
+ ['record', '--dir', dir, ...(o?.part ? ['--part', String(o.part), '--start-ms', String(Math.round(o.startMs ?? 0))] : []), ...(o?.speech ? ['--speech', o.speech] : []), ...(o?.mic ? ['--mic', o.mic] : []), ...(o?.micMuted ? ['--mic-muted'] : [])]
export function startCapture(meetingDir: string, o?: CaptureOpts): Capture {
mkdirSync(meetingDir, { recursive: true })
- if (isFake()) return new Capture(fakeCaptureProc(meetingDir, o?.startMs ?? 0, { speech: !!o?.speech, part: o?.part, mic: o?.mic }), { startMs: o?.startMs })
+ if (isFake()) return new Capture(fakeCaptureProc(meetingDir, o?.startMs ?? 0, { speech: !!o?.speech, part: o?.part, mic: o?.mic, micMuted: o?.micMuted }), { startMs: o?.startMs })
// straight from Yogurt, never through a shell: Windows leaves the helper's parent's process tree (Yogurt) out of the call audio
const child = spawn(audioHelperPath(), captureArgs(meetingDir, o), { stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true })
child.stderr.on('data', (d: Buffer) => console.error('yogurt-audio:', d.toString().trim()))
@@ -246,6 +255,7 @@ export type RecordingEvent =
| { t: 'warn'; code: WarnCode | TranscribeWarn }
| { t: 'hiccup' }
| { t: 'gave-up' }
+ | { t: 'mic-state'; meetingId: string; state: MicState }
| { t: 'paused'; meetingId: string; paused: boolean; at: number }
const recordingListeners: Array<(e: RecordingEvent) => void> = []
export const onRecordingEvent = (fn: (e: RecordingEvent) => void) => { recordingListeners.push(fn); return () => { const i = recordingListeners.indexOf(fn); if (i >= 0) recordingListeners.splice(i, 1) } }
@@ -258,7 +268,20 @@ export const onCaptureStart = (fn: (c: Capture, meetingId: string) => void) => {
* The meeting being recorded: its folder, how many restarts it has had (each restart is a part), and its "files are
* final" promise, made when it starts so a hook that runs before ours on Stop still waits for the recorder
*/
-let session: { id: string; dir: string; parts: number; paused: boolean; startedAt: number; restart?: () => void; join: (dir: string) => Promise<void>; settled: Promise<void>; settle: () => void } | null = null
+type MicSource = 'note' | 'widget' | 'restore'
+let session: { id: string; dir: string; parts: number; paused: boolean; startedAt: number; micState: MicState; requestMic(muted: boolean, source: MicSource): boolean; pendingMic?: { id: number; muted: boolean; started: number; timer: NodeJS.Timeout }; restart?: () => void; join: (dir: string) => Promise<void>; settled: Promise<void>; settle: () => void } | null = null
+function endMicRequest(s: NonNullable<typeof session>, outcome: 'confirmed' | 'failed', detail: string) {
+ const pending = s.pendingMic
+ if (!pending) return
+ clearTimeout(pending.timer)
+ delete s.pendingMic
+ console.info(`MIC ${pending.muted ? 'mute' : 'unmute'} ${outcome} meeting=${s.id} request=${pending.id} durationMs=${Math.round(performance.now() - pending.started)} ${detail}`)
+}
+export function setMicMuted(id: string, muted: boolean, source: 'note' | 'widget' = 'note'): boolean {
+ if (session?.id === id && !session.paused) return session.requestMic(muted, source)
+ console.info(`MIC ${muted ? 'mute' : 'unmute'} ignored meeting=${id} source=${source} reason=${session?.id === id ? 'paused' : 'inactive'} durationMs=0`)
+ return false
+}
export const recordingPaused = (id: string): boolean => session?.id === id && session.paused
/** Pause the current helper without ending its files, transcript session or meeting. */
export function setRecordingPaused(id: string, paused: boolean): boolean {
@@ -284,6 +307,7 @@ function finish(): Promise<void> {
const s = session, c = active
active = null; session = null
if (!s) return Promise.resolve()
+ endMicRequest(s, 'failed', 'reason=recording-stopped')
inFlight.add(s.settled)
void (async () => {
try { await c?.stop(); if (s.parts > 0) await s.join(s.dir) } catch (e) { console.error('finishing the recording failed', e) }
@@ -358,7 +382,38 @@ export function hookCapture(p: {
const dir = p.dirOf(m.id)
let settle!: () => void
const settled: Promise<void> = new Promise<void>((r) => { settle = r }).finally(() => { inFlight.delete(settled); if (finished.get(m.id) === settled) finished.delete(m.id) })
- const s: NonNullable<typeof session> = session = { id: m.id, dir, parts: m.resume?.part ?? 0, paused: false, startedAt: Date.now() - (m.resume?.startMs ?? 0), join: p.join ?? joinParts, settled, settle }
+ let request = 0
+ const micState = (state: MicState) => {
+ s.micState = state
+ tell({ t: 'mic-state', meetingId: m.id, state })
+ }
+ const unconfirmed = (c: Capture, reason: string) => {
+ if (active !== c || session !== s) return
+ endMicRequest(s, 'failed', `reason=${reason}`)
+ micState('unconfirmed')
+ // Exit (including the kill fallback) is the boundary when a helper cannot confirm.
+ void c.stop()
+ }
+ const requestMic = (muted: boolean, source: MicSource): boolean => {
+ const restore = source === 'restore'
+ const c = active
+ const action = muted ? 'mute' : 'unmute'
+ if (!c || session !== s || s.micState === 'unconfirmed') {
+ console.info(`MIC ${action} ignored meeting=${m.id} source=${source} reason=unavailable durationMs=0`)
+ return false
+ }
+ if (s.pendingMic || (!restore && muted === micIsOff(s.micState))) {
+ console.info(`MIC ${action} ignored meeting=${m.id} source=${source} reason=${s.pendingMic ? 'pending' : 'already-set'} durationMs=0`)
+ return !s.pendingMic || s.pendingMic.muted === muted
+ }
+ const id = ++request
+ s.pendingMic = { id, muted, started: performance.now(), timer: setTimeout(() => unconfirmed(c, 'timeout'), 5000) }
+ console.info(`MIC ${action} requested meeting=${m.id} request=${id} source=${source}`)
+ micState(restore && micIsOff(s.micState) ? 'restoring-off' : muted ? 'muting' : 'unmuting')
+ if (!c.setMicMuted(muted, id)) unconfirmed(c, 'command-write')
+ return true
+ }
+ const s: NonNullable<typeof session> = session = { id: m.id, dir, parts: m.resume?.part ?? 0, paused: false, micState: 'on', requestMic, startedAt: Date.now() - (m.resume?.startMs ?? 0), join: p.join ?? joinParts, settled, settle }
finished.set(m.id, settled)
const speech = p.speech?.(m.id) ?? null
const micOpt = () => { const mic = p.mic?.() ?? null; return mic ? { mic } : {} }
@@ -368,7 +423,8 @@ export function hookCapture(p: {
const prev = active!
const restart = () => {
const startMs = Math.max(prev.endMs, Date.now() - s.startedAt)
- attach(begin(dir, { part: s.parts + 1, startMs, ...(speech ? { speech } : {}), ...micOpt() })); s.parts++
+ const restoreOff = s.micState !== 'on'
+ attach(begin(dir, { ...(restoreOff ? { micMuted: true } : {}), part: s.parts + 1, startMs, ...(speech ? { speech } : {}), ...micOpt() }), restoreOff); s.parts++
}
if (s.paused) s.restart = restart
else restart()
@@ -378,8 +434,20 @@ export function hookCapture(p: {
})
// how loud each side got, once a minute in main.log (levelLog.ts)
const levels = createLevelLog()
- const attach = (c: Capture) => {
+ const attach = (c: Capture, restoreOff = false) => {
active = c
+ c.on('mic-muted', ack => {
+ if (active !== c || session !== s || ack.id !== s.pendingMic?.id) {
+ console.info(`MIC stale reply meeting=${m.id} request=${ack.id} muted=${ack.muted} boundaryMs=${ack.ms}`)
+ return
+ }
+ const wanted = s.pendingMic.muted
+ if (wanted && !ack.muted) { unconfirmed(c, 'mute-refused'); return }
+ c.emit('mic-boundary', ack)
+ const matched = ack.muted === wanted
+ endMicRequest(s, matched ? 'confirmed' : 'failed', `muted=${ack.muted} boundaryMs=${ack.ms}${matched ? '' : ' reason=still-off'}`)
+ micState(!matched ? 'still-off' : ack.muted ? 'off' : 'on')
+ })
c.on('warn', (code) => { console.warn('capture warning', code); tell({ t: 'warn', code }) })
c.on('level', (lv) => {
tell({ t: 'level', me: s.paused ? 0 : lv.me, them: s.paused ? 0 : lv.them })
@@ -389,11 +457,15 @@ export function hookCapture(p: {
c.on('ended', (e) => {
// a capture that was stopped on purpose or replaced is not ours to judge
if (active !== c) return
+ endMicRequest(s, 'failed', 'reason=helper-ended')
+ if (s.micState === 'unconfirmed') { tell({ t: 'gave-up' }); void finish(); p.stopMeeting(m.id); return }
+ if (s.paused && s.micState === 'unmuting') micState('off')
if (!e.crashed) { active = null; session = null; s.settle(); return }
console.error('capture ended unexpectedly', m.id)
policy.ended(e)
})
for (const fn of [...captureListeners]) { try { fn(c, m.id) } catch (err) { console.error('capture listener failed', err) } }
+ if (restoreOff) requestMic(true, 'restore')
}
const base = m.resume ? { part: m.resume.part, startMs: m.resume.startMs, ...(speech ? { speech } : {}) } : speech ? { speech } : undefined
const mic = micOpt()
diff --git a/app/src/main/fakeCapture.ts b/app/src/main/fakeCapture.ts
index e56c0351..ad671f8a 100644
--- a/app/src/main/fakeCapture.ts
+++ b/app/src/main/fakeCapture.ts
@@ -61,7 +61,7 @@ const SPEECH: Array<{ track: Track; at: number; finalMs: number; text: string }>
{ track: 'them', at: 13_300, finalMs: 2000, text: 'She will send a draft by Friday.' },
]
-export function fakeCaptureProc(meetingDir: string, startMs = 0, o: { speech?: boolean; part?: number; mic?: string | null } = {}): CaptureProc {
+export function fakeCaptureProc(meetingDir: string, startMs = 0, o: { speech?: boolean; part?: number; mic?: string | null; micMuted?: boolean } = {}): CaptureProc {
const ev = new EventEmitter()
const stdout = new PassThrough(), stdin = new PassThrough()
const audio: Record<Track, Float32Array> = {
@@ -70,6 +70,7 @@ export function fakeCaptureProc(meetingDir: string, startMs = 0, o: { speech?: b
}
const started = Date.now()
if (o.part) writeFileSync(join(meetingDir, `part.${o.part}.json`), JSON.stringify({ startMs }))
+ let muted = !!o.micMuted, micFrom = 0
let sent = 0, paused = false, ended = false
// like the helper: the chosen mic if it is here, else Auto; each start or switch says which mic records
const here = (uid: string) => fakeMicList().some((m) => m.uid === uid)
@@ -93,6 +94,7 @@ export function fakeCaptureProc(meetingDir: string, startMs = 0, o: { speech?: b
const speechAt = (ms: number) => {
if (!o.speech) return
for (const e of SPEECH) {
+ if (e.track === 'me' && (muted || e.at < micFrom)) continue
const since = ms - e.at
if (since < SPEECH_STEP_MS) continue
const words = e.text.split(' ')
@@ -118,37 +120,59 @@ export function fakeCaptureProc(meetingDir: string, startMs = 0, o: { speech?: b
const finish = (code: number | null, signal: NodeJS.Signals | null) => {
if (ended) return
+ playUntil(elapsedSamples())
ended = true; clearInterval(timer)
for (const track of ['me', 'them'] as const) writeFileSync(join(meetingDir, o.part ? `${track}.${o.part}.wav` : `${track}.wav`), wavOf(played[track]))
stdout.end()
setImmediate(() => ev.emit('exit', code, signal))
}
- const timer = setInterval(() => {
- checkMics()
+ const playUntil = (target: number) => {
// everything due by now, in 100 ms chunks, so slow timers don't slow the audio
- while (sent + CHUNK <= ((Date.now() - started) * RATE) / 1000) {
+ while (sent < target) {
+ const count = Math.min(CHUNK, target - sent)
const ms = startMs + (sent / RATE) * 1000
- sent += CHUNK
+ sent += count
// like the helper: a pause is silence in the files, so file time stays meeting time
- if (paused) { played.me.push(new Float32Array(CHUNK)); played.them.push(new Float32Array(CHUNK)); continue }
+ if (paused) { played.me.push(new Float32Array(count)); played.them.push(new Float32Array(count)); continue }
const lv = { me: 0, them: 0 }
for (const track of ['me', 'them'] as const) {
- const src = audio[track], from = sent - CHUNK
- const samples = new Float32Array(CHUNK)
- if (from < src.length) samples.set(src.subarray(from, Math.min(sent, src.length)))
+ const src = audio[track], from = sent - count
+ const samples = new Float32Array(count)
+ if ((track === 'them' || !muted) && from < src.length) samples.set(src.subarray(from, Math.min(sent, src.length)))
lv[track] = level(samples)
played[track].push(samples)
+ if (track === 'me' && muted) continue
stdout.write(encodeFrame({ t: 'pcm', track, ms, samples }))
}
stdout.write(encodeFrame({ t: 'level', ...lv }))
speechAt(ms - startMs)
}
+ }
+ const elapsedSamples = () => Math.max(sent, Math.floor((Date.now() - started) * RATE / 1000))
+ const timer = setInterval(() => {
+ checkMics()
+ playUntil(sent + Math.floor((elapsedSamples() - sent) / CHUNK) * CHUNK)
}, 50)
+ const applyMute = (cmd: string) => {
+ if (ended) return
+ playUntil(elapsedSamples())
+ const ms = sent / RATE * 1000
+ muted = cmd.startsWith('mute ') || (muted && process.env.YOGURT_FAKE_MIC_ACK === 'stay-off')
+ micFrom = ms
+ settled.me = startMs + ms
+ stdout.write(encodeFrame({ t: 'mic-muted', id: Number(cmd.split(' ')[1]), muted, ms: startMs + ms }))
+ }
+
stdin.on('data', (d: Buffer) => {
for (const cmd of d.toString().split('\n')) {
if (cmd === 'pause') paused = true
else if (cmd === 'resume') paused = false
+ else if (/^(un)?mute [0-9]+$/.test(cmd)) {
+ if (process.env.YOGURT_FAKE_MIC_ACK === 'missing') continue
+ if (process.env.YOGURT_FAKE_MIC_ACK === 'slow') setTimeout(() => applyMute(cmd), 1800)
+ else applyMute(cmd)
+ }
else if (cmd.startsWith('mic ')) {
const uid = cmd.slice(4).trim()
if (uid === 'auto' || here(uid)) mic = uid === 'auto' ? null : uid
diff --git a/app/src/main/index.ts b/app/src/main/index.ts
index ce9a233c..a62d0b5d 100644
--- a/app/src/main/index.ts
+++ b/app/src/main/index.ts
@@ -60,7 +60,7 @@ import { deleteMeeting } from './deleteMeeting'
import { emptyTrash, moveToTrash, purgeTrash } from './trash'
import { isId, text, rewriteNote } from './ipcArgs'
import { hookMics } from './mics'
-import { activeCapture, audioHelperPath, hookCapture, joinParts, onCaptureStart, onRecordingEvent, prepareAppend, recordingFinished, recordingPaused, recordingSettled, rejoinInterrupted, setRecordingPaused, settleRecording, tell, type WarnCode } from './capture'
+import { activeCapture, audioHelperPath, hookCapture, joinParts, onCaptureStart, onRecordingEvent, prepareAppend, recordingFinished, recordingPaused, recordingSettled, rejoinInterrupted, setMicMuted, setRecordingPaused, settleRecording, tell, type WarnCode } from './capture'
import { createWidget } from './widget'
import { liveSilentMs, hookTranscription, transcribeRecorded, onWhisperGpuOff, meetingLanguage, settleTranscription, speechLocaleFor, spokenChanged, transcriptionBacklogMs, stopTranscriptionServer, releaseIdleSpeech, transcriptFinished, transcriptOpen, transcriptPartials } from './asr'
import { hookCallNames, type Watch } from './callNames'
@@ -476,6 +476,10 @@ function startDetection() {
return changed
}
ipcMain.handle('meetings:set-paused', (_e, id: unknown, paused: unknown) => pauseRecording(id, paused))
+ ipcMain.handle('meetings:set-mic-muted', (e, id: unknown, muted: unknown) => {
+ if (e.senderFrame !== e.sender.mainFrame || (e.sender !== win?.webContents && !widget.owns(e.sender))) return false
+ return isId(id) && typeof muted === 'boolean' && activeMeeting()?.id === id && setMicMuted(id, muted, e.sender === win?.webContents ? 'note' : 'widget')
+ })
recordingControls = { start: startNotes, pause: pauseRecording }
ipcMain.handle('meetings:retry-stop-save', (_e, id: unknown) => isId(id) && retryStopSave(id))
// the menu bar: open, new note or stop, quit; Yogurt stays there with its window closed
diff --git a/app/src/main/widget.ts b/app/src/main/widget.ts
index 3ff46ecd..f2813234 100644
--- a/app/src/main/widget.ts
+++ b/app/src/main/widget.ts
@@ -1,11 +1,11 @@
-import { micFloor, silentSpeech, speechSample } from '../shared/speechWave'
+import { recordingSpeech, silentSpeech } from '../shared/speechWave'
import { BrowserWindow, ipcMain, Notification, screen } from 'electron'
import { join } from 'node:path'
import type { Meeting } from './store'
import { WidgetModel } from './widgetModel'
import { onRecordingEvent, recordingFinished } from './capture'
import { onMeetingChange, onMeetingStart, onMeetingStop, stopSavePending } from './meeting'
-import type { WidgetView } from '../shared/types'
+import { micIsOff, type WidgetView } from '../shared/types'
import { floatingType, floatOverFullScreen } from './float'
import { isFake } from './paths'
import { t, onLanguage } from '../shared/i18n'
@@ -63,7 +63,7 @@ export function createWidget(d: { open(meetingId: string): void; stop(meetingId:
platform?: NodeJS.Platform }) {
const model = new WidgetModel(d.os)
let speech = silentSpeech
- let micLevels: number[] = []
+ const floors = { me: [] as number[], them: [] as number[] }
let win: BrowserWindow | undefined
/**
* Linux (X11): Electron crashes when a window is destroyed while the X server still answers about its size, as
@@ -161,7 +161,7 @@ export function createWidget(d: { open(meetingId: string): void; stop(meetingId:
onMeetingStart((m) => {
speech = silentSpeech
- micLevels = []
+ floors.me.length = floors.them.length = 0
notifyOnChange = false; notice = null; stopPressed = false
model.start({ id: m.id, title: m.title, startedAt: m.resume ? m.resume.startedAt - m.resume.capturedMs : m.startedAt })
open(); push()
@@ -200,8 +200,12 @@ export function createWidget(d: { open(meetingId: string): void; stop(meetingId:
onRecordingEvent((e) => {
if (!model.meetingId) return
if (e.t === 'level') {
- speech = speechSample(speech, e, performance.timeOrigin + performance.now(), micFloor(micLevels, e))
+ speech = recordingSpeech(speech, e, floors, micIsOff(model.micState), performance.timeOrigin + performance.now())
broadcast('widget:level', { me: e.me, them: e.them, speech })
+ } else if (e.t === 'mic-state' && e.meetingId === model.meetingId) {
+ if (micIsOff(model.micState) !== micIsOff(e.state)) speech = silentSpeech
+ model.micState = e.state
+ push()
} else if (e.t === 'paused' && e.meetingId === model.meetingId) { model.pause(e.paused, e.at); push() }
else if (e.t === 'warn') { model.warn(e.code); push() }
else if (e.t === 'gave-up') model.gaveUp()
@@ -283,6 +287,7 @@ export function createWidget(d: { open(meetingId: string): void; stop(meetingId:
return {
visibilityChanged,
+ owns: (sender: Electron.WebContents) => !!win && !win.isDestroyed() && sender === win.webContents,
elapsed: () => model.view(Date.now())?.elapsedMs ?? 0,
/** the recording is about to stop because its call ended: the finished card says so */
callEnded: (meetingId: string) => { if (model.meetingId === meetingId) model.callEnded() },
diff --git a/app/src/main/widgetModel.ts b/app/src/main/widgetModel.ts
index 42b555c7..412deb2b 100644
--- a/app/src/main/widgetModel.ts
+++ b/app/src/main/widgetModel.ts
@@ -1,5 +1,5 @@
import type { TranscribeWarn, WarnCode } from './capture'
-import type { WidgetView } from '../shared/types'
+import { micIsOff, type MicState, type WidgetView } from '../shared/types'
import { t } from '../shared/i18n'
export { formatElapsed } from '../shared/wave'
@@ -23,13 +23,14 @@ export class WidgetModel {
private hiccupUntil = 0
private crashed = false
private savePending = false
+ micState: MicState = 'on'
private pausedAt: number | null = null
private pausedMs = 0
/** the recording stopped by itself because the call ended */
private byCall = false
start(m: { id: string; title: string; startedAt: number }) {
- this.m = m; this.kind = 'recording'
+ this.m = m; this.micState = 'on'; this.kind = 'recording'
this.missingAudio.clear(); this.textHint = null; this.hiccupUntil = 0; this.crashed = false; this.savePending = false
this.pausedAt = null; this.pausedMs = 0; this.byCall = false
}
@@ -63,17 +64,21 @@ export class WidgetModel {
if (!m) return null
const end = this.pausedAt ?? (this.kind === 'captured' ? this.endedAt : now)
let note: WidgetView['note'] = null
+ const muted = micIsOff(this.micState)
if (this.kind === 'recording') {
if (now < this.hiccupUntil) note = { tone: 'hiccup', text: this.pausedAt !== null ? t('Recording is still paused after an interruption.') : t('Recording resumed after an interruption.') }
- else if (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 (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 (muted && this.missingAudio.has('systemAudio')) note = { tone: 'hint', code: 'no-system-audio', text: t("Mic off. Yogurt can’t hear call audio.") }
+ 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 === '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.') }
}
else if (this.savePending) note = { tone: 'hint', text: t('Recording stopped. Open Yogurt to finish saving.') }
+ else if (this.micState === 'unconfirmed') note = { tone: 'hint', text: t('Mic mute couldn’t be confirmed.') }
return {
+ ...(this.micState !== 'on' ? { micState: this.micState } : {}),
kind: this.kind, meetingId: m.id, title: m.title,
elapsedMs: Math.max(0, end - m.startedAt - this.pausedMs), at: now, note, crashed: this.crashed,
...(this.pausedAt !== null ? { paused: true } : {}),
diff --git a/app/src/preload/index.ts b/app/src/preload/index.ts
index d68fc63e..70d066e2 100644
--- a/app/src/preload/index.ts
+++ b/app/src/preload/index.ts
@@ -74,6 +74,7 @@ const api: YogurtApi = {
startPrepared: (id) => ipcRenderer.invoke('meetings:start-prepared', id),
resume: (id) => ipcRenderer.invoke('meetings:resume', id),
stop: (id) => { ipcRenderer.send('meetings:stop', id) },
+ setMicMuted: (id, muted) => ipcRenderer.invoke('meetings:set-mic-muted', id, muted),
setPaused: (id, paused) => ipcRenderer.invoke('meetings:set-paused', id, paused),
retryStopSave: (id) => ipcRenderer.invoke('meetings:retry-stop-save', id),
rename: (id, title) => ipcRenderer.invoke('meetings:rename', id, title),
diff --git a/app/src/renderer/src/components/MicToggle.tsx b/app/src/renderer/src/components/MicToggle.tsx
new file mode 100644
index 00000000..ce0428f1
--- /dev/null
+++ b/app/src/renderer/src/components/MicToggle.tsx
@@ -0,0 +1,47 @@
+import { useEffect, useState, type MouseEvent, type KeyboardEvent } from 'react'
+import { t } from '../../../shared/i18n'
+import { micIsOff, micPendingAction, type MicState } from '../../../shared/types'
+import { Mic, MicOff, TriangleAlert } from './Icons'
+import { RecordingAction } from './RecordingAction'
+
+export function MicToggle({ id, state, paused, pill }: { id: string; state?: MicState; paused?: boolean; pill?: boolean }) {
+ const off = micIsOff(state)
+ const pending = !!micPendingAction(state)
+ const label = off ? t('Unmute my mic') : t('Mute my mic')
+ const tooltip = off ? t('Unmute my mic in Yogurt') : t('Mute my mic in Yogurt')
+ const Icon = state === 'unconfirmed' ? TriangleAlert : off ? MicOff : Mic
+ const props = {
+ 'data-testid': pill ? 'widget-mic' : 'note-mic',
+ 'aria-pressed': state === 'unconfirmed' ? 'mixed' as const : off,
+ 'aria-busy': pending,
+ disabled: paused || pending || state === 'unconfirmed',
+ onClick: (event: MouseEvent<HTMLButtonElement>) => {
+ if (!pending && event.detail <= 1) void window.yogurt.meetings.setMicMuted(id, !off)
+ },
+ onKeyDown: (event: KeyboardEvent<HTMLButtonElement>) => {
+ if (event.repeat && (event.key === 'Enter' || event.key === ' ')) event.preventDefault()
+ },
+ children: <Icon size={14} aria-hidden="true" />,
+ }
+ return pill
+ ? <button {...props} type="button" className="widget-mic no-drag" aria-label={label} title={tooltip} />
+ : <RecordingAction {...props} className="note-record-action note-mic-action" label={label} tooltip={tooltip} />
+}
+
+export function MicFeedback({ state, paused }: { state?: MicState; paused?: boolean }) {
+ const pending = micPendingAction(state)
+ const [slow, setSlow] = useState<typeof pending>()
+ useEffect(() => {
+ setSlow(undefined)
+ if (!pending) return
+ const timer = setTimeout(() => setSlow(pending), 700)
+ return () => clearTimeout(timer)
+ }, [pending])
+ const off = micIsOff(state)
+ const text = pending === 'muting' ? t('Muting mic…') : pending === 'unmuting' ? t('Unmuting mic…')
+ : state === 'unconfirmed' ? t('Mic mute couldn’t be confirmed.') : state === 'still-off' ? t('Mic is still off. Try again.')
+ : off && paused ? t('Mic will stay off on resume') : off ? t('Mic off in Yogurt') : t('Mic on in Yogurt')
+ const quiet = !state || state === 'on' || (state === 'off' && !paused)
+ if (pending) return <p role="status" className={slow === pending ? 'mic-pending-status' : 'sr-only'}>{slow === pending ? text : ''}</p>
+ return <p role="status" className={quiet ? 'sr-only' : 'mic-feedback'}>{text}</p>
+}
diff --git a/app/src/renderer/src/components/RecordingAction.tsx b/app/src/renderer/src/components/RecordingAction.tsx
index de1e5d97..8af5e108 100644
--- a/app/src/renderer/src/components/RecordingAction.tsx
+++ b/app/src/renderer/src/components/RecordingAction.tsx
@@ -2,9 +2,9 @@ import { Tooltip } from '@base-ui/react/tooltip'
import { ActionTooltipPopup } from './ActionTooltipPopup'
import type { ButtonHTMLAttributes } from 'react'
-export function RecordingAction({ label, ...button }: ButtonHTMLAttributes<HTMLButtonElement> & { label: string }) {
+export function RecordingAction({ label, tooltip = label, ...button }: ButtonHTMLAttributes<HTMLButtonElement> & { label: string; tooltip?: string }) {
return <Tooltip.Root>
- <Tooltip.Trigger {...button} aria-label={label} delay={180} />
- <ActionTooltipPopup label={label} />
+ <Tooltip.Trigger type="button" {...button} render={<button disabled={button.disabled} />} aria-label={label} delay={180} />
+ <ActionTooltipPopup label={tooltip} />
</Tooltip.Root>
}
diff --git a/app/src/renderer/src/components/RecordingPill.tsx b/app/src/renderer/src/components/RecordingPill.tsx
index 645779c8..44b4234a 100644
--- a/app/src/renderer/src/components/RecordingPill.tsx
+++ b/app/src/renderer/src/components/RecordingPill.tsx
@@ -1,9 +1,8 @@
import type { ComponentPropsWithRef } from 'react'
-import { TriangleAlert } from './Icons'
import { LevelBars } from './LevelBars'
import { Logo } from './Logo'
-type Props = ComponentPropsWithRef<'div'> & { time: string; warning?: boolean; illustration?: boolean }
+type Props = ComponentPropsWithRef<'div'> & { time: string; illustration?: boolean }
function StillMeter() {
return <svg data-testid="widget-wave" width="27" height="16" aria-hidden="true" fill="var(--pill-accent)" opacity=".835">
@@ -12,10 +11,10 @@ function StillMeter() {
</svg>
}
-export function RecordingPill({ time, warning, illustration, className = '', children, ...props }: Props) {
+export function RecordingPill({ time, illustration, className = '', children, ...props }: Props) {
return <div {...props} data-illustration={illustration || undefined} className={`widget-pill ${className}`}>
<div className="widget-details" aria-hidden="true">
- <span className="text-[var(--pill-accent)]">{warning ? <TriangleAlert data-testid="widget-warning" size={18} /> : <Logo size={18} className="text-[var(--pill-accent)]" />}</span>
+ <span><Logo size={18} className="text-[var(--pill-accent)]" /></span>
{illustration ? <StillMeter /> : <LevelBars testId="widget-wave" height={16} className="text-[var(--pill-accent)]" />}
<span data-testid="widget-time" className="widget-time">{time}</span>
</div>
diff --git a/app/src/renderer/src/components/Transcript.tsx b/app/src/renderer/src/components/Transcript.tsx
index 8c9ac255..6e3d38fe 100644
--- a/app/src/renderer/src/components/Transcript.tsx
+++ b/app/src/renderer/src/components/Transcript.tsx
@@ -11,7 +11,7 @@ import { AudioLines, ArrowDown } from './Icons'
import type { Segment, TranscriptPartial } from '../../../shared/types'
import { t } from '../../../shared/i18n'
import { useLanguage } from '../i18n'
-import { transcriptSpeaker, bubbles, clock, echoRuns, lineAt, recentRuns, stableKeys, turns, withLive, type LiveSaid } from '../../../shared/transcript'
+import { transcriptRowKey, transcriptSpeaker, bubbles, clock, echoRuns, lineAt, recentRuns, stableKeys, turns, withLive, type LiveSaid } from '../../../shared/transcript'
import { TranscriptFind } from './TranscriptFind'
import { Player, type PlayerHandle } from './Player'
import { attachPlayerVisibility } from '../playerVisibility'
@@ -385,7 +385,7 @@ export function Transcript({ id, notice, processing=false, replacing=false, reco
else if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); follow(); player.current?.playFrom(lines[i].startMs) }
}
- const grouped = useMemo(() => timeline.map(run => ({ ...run, k: key(run.lines[0]) })), [timeline])
+ const grouped = useMemo(() => timeline.map((run, i) => ({ ...run, k: key(run.lines[0]), rowKey: transcriptRowKey(run.lines[0].track, timeline[i - 1]?.lines.at(-1)) })), [timeline])
const drawn = useMemo(() => (recording && !showAll ? recentRuns(grouped, LIVE_LINES, LIVE_STEP) : { runs: grouped, earlier: 0 }), [grouped, recording, showAll])
const find = useCallback((open: boolean) => {
setFinding(open)
@@ -413,21 +413,21 @@ export function Transcript({ id, notice, processing=false, replacing=false, reco
</div>
</li>}
{drawn.earlier > 0 && <li className="flex justify-center"><button data-testid="transcript-earlier" onClick={() => { visibility.current?.programmatic(); stick.current = false; setShowAll(true) }} className="ghost-btn">{t('Show earlier lines')}</button></li>}
- {drawn.runs.map(run => <Fragment key={run.k}>
- {turns(run.lines).map((turn) => {
+ {drawn.runs.map(run => <Fragment key={run.rowKey}>
+ {turns(run.lines).map((turn, i, groups) => {
const me = turn[0].track === 'me', first = turn[0]
const color = me || !('speakerColor' in first) ? undefined : first.speakerColor
// a name comes with the first final line; until then its place is kept, so nothing moves when it shows
const named = turn.some((x) => !('live' in x))
return (
- <li key={key(first)} data-testid="transcript-turn" data-track={first.track} className={`transcript-turn flex flex-col gap-[5px] ${me ? 'items-end' : 'items-start'}`}>
+ <li key={transcriptRowKey(first.track, groups[i - 1]?.at(-1))} data-testid="transcript-turn" data-track={first.track} className={`transcript-turn flex flex-col gap-[5px] ${me ? 'items-end' : 'items-start'}`}>
{/* the other side's name heads their turn; the mic's side needs none, its bubbles sit at the end */}
<p className={me ? 'sr-only' : 'turn-head flex items-baseline gap-2 px-1 text-xs'}>
<span data-testid="transcript-who" data-color={color} data-folder-color={color === undefined ? undefined : SPEAKER_COLORS[color]} className={`line-who font-medium ${me ? '' : 'text-muted'} ${named ? 'name-in' : 'invisible'}`}>{who(first)}</span>
<time className="turn-time tabular-nums text-muted">{clock(first.startMs)}</time>
</p>
- {bubbles(turn).map((b) => (
- <p key={key(b[0])} data-testid="transcript-bubble" data-track={first.track} dir="auto" className={`bubble ${me ? 'bubble-me' : 'bubble-them'}`}>
+ {bubbles(turn).map((b, i, groups) => (
+ <p key={transcriptRowKey(first.track, groups[i - 1]?.at(-1))} data-testid="transcript-bubble" data-track={first.track} dir="auto" className={`bubble ${me ? 'bubble-me' : 'bubble-them'}`}>
{b.map((x, i) => {
if ('live' in x) return <Fragment key="live">{i > 0 && ' '}<LiveWords said={x.live} /></Fragment>
const k = key(x)
diff --git a/app/src/renderer/src/screens/Note.tsx b/app/src/renderer/src/screens/Note.tsx
index 6de0e574..5d06e4f7 100644
--- a/app/src/renderer/src/screens/Note.tsx
+++ b/app/src/renderer/src/screens/Note.tsx
@@ -23,6 +23,7 @@ import { Transcript } from '../components/Transcript'
import { Ask } from '../components/Chat'
import { LevelBars } from '../components/LevelBars'
import { RecordingTime } from '../components/RecordingTime'
+import { MicToggle, MicFeedback } from '../components/MicToggle'
import { RecordingAction } from '../components/RecordingAction'
import { ShareMenu } from '../components/ShareMenu'
import { NoteMenu, summaryAction } from '../components/NoteMenu'
@@ -161,7 +162,6 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource, onResu
}, [at?.seq, notes, m, hasEnhanced])
// the recorder's hints (the widget shows them too), while this meeting records
- const isRecording = m?.id === id && m.state === 'recording'
const togglePause = async () => {
const paused = !m?.paused
setPausing(true); setPauseFailed(null)
@@ -172,11 +172,13 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource, onResu
finally { setPausing(false) }
}
useEffect(() => {
- if (!isRecording) { setRecorder(null); return }
+ let current = true, updated = false
+ setRecorder(null)
const take = (v: WidgetView | null) => setRecorder(v && v.meetingId === id ? v : null)
- void window.yogurt.widget.state().then(take)
- return window.yogurt.widget.onState(take)
- }, [id, isRecording])
+ const off = window.yogurt.widget.onState(v => { updated = true; take(v) })
+ void window.yogurt.widget.state().then(v => { if (current && !updated) take(v) })
+ return () => { current = false; off() }
+ }, [id])
useEffect(() => {
let version = 0
@@ -397,6 +399,7 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource, onResu
</>}
<div data-testid="note-state" data-state={m.state} data-paused={!!m.paused} className="note-recording-group" data-treatment={RECORDING_CONTROL_TREATMENT} data-recording={recording && !finishing} role="group" aria-label={recording ? m.paused ? t('Paused') : t('Recording') : t('Meeting controls')}>
{recording && !finishing && <>
+ <MicToggle id={id} state={recorder?.micState} paused={!!m.paused || recorder?.kind !== 'recording' || recorder.meetingId !== id} />
<RecordingAction data-testid="note-pause" disabled={pausing} onClick={() => { void togglePause() }}
label={m.paused ? t('Resume recording') : t('Pause recording')} className="note-record-action note-pause-action">
<Swap show={m.paused ? 'play' : 'pause'} options={{ pause: <Pause className="flex-none" size={14} fill="currentColor" strokeWidth={0} />, play: <Play className="flex-none" size={14} fill="currentColor" strokeWidth={0} /> }} />
@@ -499,6 +502,8 @@ export function Note({ id, onTitleChange, at, folderSuggestion, onSource, onResu
{startFailed && <p role="alert" className="pointer-events-auto mx-auto mt-3 w-fit text-[13px] text-danger">{t("Yogurt couldn't start the notes. Try again in a moment.")}</p>}
{resumeFailed && <p data-testid="note-resume-failed" role="alert" className="pointer-events-auto mx-auto mt-3 w-fit max-w-[calc(100%-32px)] text-[13px] text-danger">{t("Couldn't resume recording. Your existing note and audio are kept. Try again.")}</p>}
{pauseFailed && recording && <p role="alert" className="pointer-events-auto mx-auto mt-3 w-fit text-[13px] text-danger">{pauseFailed === 'pause' ? t("Couldn't pause the recording. Try again.") : t("Couldn't resume the recording. Try again.")}</p>}
+ {recording && recorder?.meetingId === id && <MicFeedback state={recorder.micState} paused={!!m.paused} />}
+ {!recording && recorder?.meetingId === id && recorder.micState === 'unconfirmed' && <MicFeedback state="unconfirmed" />}
{recording && hint && <RecordingHint hint={hint} />}
<div className="note-footer-bar">
<div className="note-status pointer-events-auto flex flex-wrap items-center gap-1.5 text-[11px] text-muted">
diff --git a/app/src/renderer/src/styles.css b/app/src/renderer/src/styles.css
index 4fa5fa48..b8504a9b 100644
--- a/app/src/renderer/src/styles.css
+++ b/app/src/renderer/src/styles.css
@@ -176,6 +176,17 @@ html.widget, .widget-pill[data-illustration] { --pill:#232326;--pill-ink:#F7F7FA
.widget-pill[data-illustration] { width:max-content;border-radius:10px;color:var(--pill-ink);direction:ltr; }
.widget-pill[data-illustration] .widget-details { position:static;display:flex;align-items:center;gap:12px;height:40px;padding:0 12px; }
.widget-pill[data-illustration] .widget-details>* { position:static; }
+.widget-mic { position:absolute;z-index:2;right:9px;top:10px;display:grid;place-items:center;width:28px;height:28px;border-radius:5px;color:var(--pill-ink); }
+.widget-mic[aria-busy=true] { opacity:.55; }
+.widget-mic:hover { background:#FFFFFF14; }
+.widget-mic:focus-visible { outline:2px solid var(--pill-accent); }
+.widget-mic[aria-pressed=true] { color:#FF797C;background:#FF5E661A; }
+.widget-mic-status { position:absolute;right:12px;top:8px;height:24px;display:flex;align-items:center;border-left:1px solid var(--widget-line);padding-left:12px; }
+.widget-mic-off { display:grid;place-items:center;width:24px;height:24px;border-radius:7px;color:#E5484D;background:rgba(229,72,77,.14); }
+.mic-feedback { margin:6px auto;font-size:13px;text-align:center; }
+.mic-pending-status { position:absolute;z-index:2;margin:0;font-size:12px;line-height:18px;pointer-events:none; }
+.widget-preview > .mic-pending-status { top:-36px;left:44px;right:125px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
+.note-footer > .mic-pending-status { bottom:100%;inset-inline:0;width:fit-content;max-width:100%;margin:auto;padding:2px 8px;border-radius:4px;background:var(--bg); }
.widget-time { white-space:nowrap;font-size:10px;font-weight:500;font-variant-numeric:tabular-nums;line-height:15px;opacity:.8; }
.widget-preview { position:absolute;left:0;top:52px;display:flex;flex-direction:column;padding:0 4px 12px 12px;color:var(--pill-ink);font-size:14px;line-height:21px;transform-origin:50% 0;cursor:default; }
/* closed: the transcript stays mounted but unpainted (hidden once the close has played, its live dots paused); the meter repaints only itself */
@@ -200,6 +211,7 @@ html.widget, .widget-pill[data-illustration] { --pill:#232326;--pill-ink:#F7F7FA
.widget-preview-empty { padding:12px 6px;color:#B8B8C0;font-size:13px; }
.widget-preview-latest { position:absolute;bottom:12px;inset-inline-start:50%;translate:-50% 0; }
[dir=rtl] .widget-preview-latest { translate:50% 0; }
+.widget-preview-warning p svg { display:inline-block;vertical-align:-2px;margin-inline-end:6px; }
.widget-preview-warning { flex:none;margin:0 8px 12px 0;padding:10px 12px;border-radius:10px;background:#FFFFFF06;font-size:12px;line-height:18px; }
.widget-settings { display:flex;margin-top:10px; }
.widget-preview .page-loading { --control:#FFFFFF14; }
@@ -575,9 +587,9 @@ input::selection, textarea::selection, .note-prose ::selection { background: var
.note-notes-body { padding-top:22px;padding-bottom:40px; }
.note-transcript-pane { display:flex;contain:layout style;--transcript-inset:calc(max(0px,(100% - 860px)/2) + clamp(20px,calc(10cqw - 42px),48px)); }
.transcript-turn { contain:layout style; }
-.note-footer { flex:none;margin-block-end:var(--toast-clearance,0px);background:var(--bg);--note-footer-line:color-mix(in srgb,var(--line) 60%,var(--bg)); }
+.note-footer { position:relative;flex:none;margin-block-end:var(--toast-clearance,0px);background:var(--bg);--note-footer-line:color-mix(in srgb,var(--line) 60%,var(--bg)); }
.note-footer-bar { display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:var(--workspace-footer-height);padding:8px 24px;border-top:1px solid var(--note-footer-line); }
-.note-footer-bar:not(:first-child) { margin-top:8px; }
+.note-footer > :not(.sr-only,.mic-pending-status,[hidden]) ~ .note-footer-bar { margin-top:8px; }
@media (prefers-contrast:more) { .note-footer { --note-footer-line:var(--line); } }
.note-status { min-width:0; }
.note-footer-bar>.chat-trigger { flex-shrink:0;padding-inline:8px 12px; }
@@ -588,9 +600,11 @@ input::selection, textarea::selection, .note-prose ::selection { background: var
.note-recording-group { display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-height:var(--button-height); }
.note-recording-group[data-recording=true] { height:var(--button-height);flex-wrap:nowrap;gap:0;border:1px solid var(--line);border-radius:6px;background:var(--float); }
.note-recording-group[data-recording=true] .note-record-action { flex:none;height:100%;min-width:0;padding-inline:12px;border:0;border-inline-start:1px solid var(--line);border-radius:0;background:transparent;color:var(--muted); }
-.note-recording-group[data-recording=true] .note-pause-action { width:30px;padding:0;border-inline-start:0;border-start-start-radius:5px;border-end-start-radius:5px; }
+.note-recording-group[data-recording=true] :is(.note-mic-action,.note-pause-action) { width:30px;padding:0; }
+.note-recording-group[data-recording=true] .note-mic-action { border-inline-start:0;border-start-start-radius:5px;border-end-start-radius:5px; }
+.note-recording-group[data-recording=true] .note-mic-action[aria-pressed=true] { color:var(--danger);background:color-mix(in srgb,var(--danger) 14%,transparent); }
.note-recording-group[data-recording=true] .note-record-action:last-child { border-start-end-radius:6px;border-end-end-radius:6px; }
-.note-recording-group[data-recording=true] .note-record-action:hover:not(:disabled) { background:var(--control-hover);color:var(--ink); }
+.note-recording-group[data-recording=true] .note-record-action:hover:not(:disabled,[aria-pressed=true]) { background:var(--control-hover);color:var(--ink); }
.note-recording-group[data-recording=true] .note-record-action:active:not(:disabled) { background:var(--control-pressed); }
.note-recording-group[data-recording=true] .note-finish-action { width:30px;padding:0; }
.note-finish-action::before { content:"";width:8px;height:8px;border-radius:2px;background:currentColor; }
diff --git a/app/src/renderer/src/windows/Widget.tsx b/app/src/renderer/src/windows/Widget.tsx
index 1196ffb2..7694d695 100644
--- a/app/src/renderer/src/windows/Widget.tsx
+++ b/app/src/renderer/src/windows/Widget.tsx
@@ -1,13 +1,15 @@
-import { transcriptSpeaker } from '../../../shared/transcript'
+import { transcriptRowKey, transcriptSpeaker } from '../../../shared/transcript'
import { SPEAKER_COLORS } from '../../../shared/speakerColors'
import { widgetDragDelta, isWidgetClick, type WidgetPress } from '../../../shared/widgetGesture'
import { Loading } from '../components/Loading'
import { bubbles, turns, withLive } from '../../../shared/transcript'
import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
-import { ArrowDown } from '../components/Icons'
+import { ArrowDown, MicOff, TriangleAlert } from '../components/Icons'
import type { Segment, TranscriptPartial, WidgetView } from '../../../shared/types'
import { formatElapsed } from '../../../shared/wave'
import { t } from '../../../shared/i18n'
+import { MicFeedback, MicToggle } from '../components/MicToggle'
+import { micIsOff } from '../../../shared/types'
import { RecordingPill } from '../components/RecordingPill'
import { LiveWords } from '../components/Transcript'
import { glide } from '../motion'
@@ -84,8 +86,10 @@ function useWidgetView() {
const [view, setView] = useState<WidgetView | null>(null)
useEffect(() => {
document.documentElement.classList.add('widget')
- void window.yogurt.widget.state().then(setView)
- return window.yogurt.widget.onState(setView)
+ let current = true, updated = false
+ const off = window.yogurt.widget.onState(v => { updated = true; setView(v) })
+ void window.yogurt.widget.state().then(v => { if (current && !updated) setView(v) })
+ return () => { current = false; off() }
}, [])
return view
}
@@ -99,13 +103,21 @@ export function Widget() {
function Recording({ view }: { view: WidgetView }) {
const time = useElapsed(view)
const card = useRef<HTMLDivElement>(null)
- const hover = useWidgetMorph(card, !!view.note, time)
+ const muted = micIsOff(view.micState)
+ const showFeedback = view.micState === 'unconfirmed' || view.micState === 'still-off'
+ const hover = useWidgetMorph(card, !!view.note || showFeedback, time, muted)
const press = useDragOrClick(() => window.yogurt.widget.open(), hover)
- return <RecordingPill ref={card} time={time} warning={!!view.note} data-testid="widget" data-kind="recording" data-open={hover.open} role="group" tabIndex={0}
+ return <RecordingPill ref={card} time={time} data-testid="widget" data-kind="recording" data-open={hover.open} role={hover.open ? 'group' : 'button'} tabIndex={0}
className="widget-morph" {...press}
+ onFocus={e => { if (e.target.matches(':focus-visible')) hover.focus(true) }}
+ onBlur={e => { if (!e.currentTarget.contains(e.relatedTarget)) hover.focus(false) }}
onMouseMove={e => hover.pointer(e.clientX, e.clientY)}
onMouseLeave={() => hover.pointer(-1, -1)}
- aria-label={t('Open {title}', { title: view.title })} title={view.note?.text ?? t('Recording {title}', { title: view.title })}>
+ aria-label={[t('Open {title}', { title: view.title }), muted && t('Mic off in Yogurt')].filter(Boolean).join('. ')} title={view.note?.text ?? t('Recording {title}', { title: view.title })}>
+ {hover.open ? <MicToggle pill id={view.meetingId} state={view.micState} />
+ : muted && <span className="widget-mic-status" aria-hidden="true">
+ <span className="widget-mic-off" data-testid="widget-mic-off"><MicOff size={14} /></span>
+ </span>}
<Preview view={view} open={hover.open} />
</RecordingPill>
}
@@ -192,8 +204,9 @@ function Preview({ view, open }: { view: WidgetView; open: boolean }) {
const note = view.note
const permission = widgetSettings(note)
return <div data-testid="widget-preview" className="widget-preview" role="region" aria-label={t('Live transcript')} inert={!open} aria-hidden={!open}>
+ <MicFeedback state={view.micState} />
{note && <div className="widget-preview-warning" role="status">
- <p data-testid="widget-note" data-tone={note.tone}>{note.text}</p>
+ <p data-testid="widget-note" data-tone={note.tone}><TriangleAlert data-testid="widget-warning" size={14} aria-hidden="true" />{note.text}</p>
{permission && <button className="workspace-button widget-settings" onClick={() => { void window.yogurt.permissions.open(permission) }}>{t('Open Settings')}</button>}
</div>}
<ScrollFade>
@@ -206,13 +219,13 @@ function Preview({ view, open }: { view: WidgetView; open: boolean }) {
}}>
<div ref={content}>
{!loaded ? <Loading layout="transcript" testId="widget-preview-loading" /> : !grouped.length && <p className="widget-preview-empty">{failed ? t("Couldn't load the transcript. Open Yogurt to try again.") : t('Listening for speech…')}</p>}
- {grouped.map(turn => {
+ {grouped.map((turn, i) => {
const first = turn[0], me = first.track === 'me'
const who = transcriptSpeaker(first)
const color = me || !('speakerColor' in first) ? undefined : first.speakerColor
- return <div key={`${first.track}:${first.startMs}`} className="widget-preview-turn" data-me={me}>
+ return <div key={transcriptRowKey(first.track, grouped[i - 1]?.at(-1))} className="widget-preview-turn" data-me={me}>
<span className="widget-preview-speaker" data-color={color} data-folder-color={color === undefined ? undefined : SPEAKER_COLORS[color]}>{who}</span>
- {bubbles(turn).map(group => <p key={`${group[0].track}:${group[0].startMs}`} data-testid="widget-preview-bubble" className="widget-preview-bubble" dir="auto">
+ {bubbles(turn).map((group, i, groups) => <p key={transcriptRowKey(first.track, groups[i - 1]?.at(-1))} data-testid="widget-preview-bubble" className="widget-preview-bubble" dir="auto">
{group.map((line, i) => <Fragment key={`${line.track}:${line.startMs}`}>{i > 0 && ' '}{'live' in line ? <LiveWords said={line.live} /> : line.text}</Fragment>)}
</p>)}
</div>
diff --git a/app/src/renderer/src/windows/widgetMorph.ts b/app/src/renderer/src/windows/widgetMorph.ts
index c68f8c1a..c4edd1ce 100644
--- a/app/src/renderer/src/windows/widgetMorph.ts
+++ b/app/src/renderer/src/windows/widgetMorph.ts
@@ -3,11 +3,13 @@ import { motion } from '../motion'
import { WidgetIntent, widgetContains, widgetExpanded, type WidgetLayout } from '../../../shared/widgetMorph'
/** The same surface and details travel between the two shapes. */
-export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, warning: boolean, time: string) {
+export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, warning: boolean, time: string, muted: boolean) {
const intent = useRef(new WidgetIntent()).current
const [open, setOpen] = useState(false)
const [layout, setLayout] = useState<WidgetLayout | null>(null)
const pointer = useRef({ x: -1, y: -1 })
+ const keyboardFocus = useRef(false)
+ const collapsedWidth = useRef(0)
const animations = useRef<Animation[]>([])
const resumeAt = useRef<number | null>(null)
const morph = useRef((immediate = false) => { void immediate })
@@ -26,6 +28,7 @@ export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, war
void window.yogurt.widget.layout().then(v => { if (alive) setLayout(v) })
const offPointer = window.yogurt.widget.onPointer(p => { pointer.current = p; wake.current() })
const offReset = window.yogurt.widget.onReset(() => {
+ keyboardFocus.current = false
intent.open = false; intent.over = false; intent.pressed = false; intent.due = null
resumeAt.current = null; setOpen(false); morph.current(true); wake.current()
})
@@ -56,7 +59,7 @@ export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, war
if (!immediate && (!reduced || 'opacity' in to)) animations.current.push(node.animate([from, to] as Keyframe[], { duration: reduced ? motion.micro : ms, easing: ease, delay: reduced ? 0 : delay, fill: 'both' }))
}
animate(el, { left: `${box.x}px`, top: `${box.y}px`, width: `${box.width}px`, height: `${box.height}px`, borderRadius: opened ? '16px' : '10px' })
- const positions = opened ? [[16, 17], [box.width - timerWidth - 43, 18], [box.width - timerWidth - 16, 18.5]] : [[12, 11], [42, 12], [69, 12.5]]
+ const positions = opened ? [[16, 17], [box.width - timerWidth - 75, 18], [box.width - timerWidth - 48, 18.5]] : [[12, 11], [42, 12], [69, 12.5]]
items.forEach((item, i) => animate(item, { transform: `translate(${positions[i][0]}px,${positions[i][1]}px)` }))
body.style.width = `${expanded.width - 2}px`; body.style.height = `${expanded.height - 54}px`
animate(body, { transform: opened ? 'translateX(0) scale(1)' : 'translateX(40px) scale(.97)', filter: opened ? 'blur(0px)' : 'blur(2px)' }, duration, motion.ease)
@@ -75,10 +78,11 @@ export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, war
wake.current()
}, [layout, warning])
useLayoutEffect(() => {
- if (intent.pressed) return
const timer = card.current?.querySelector<HTMLElement>('[data-testid="widget-time"]')
- if (timer) window.yogurt.widget.size(83 + timer.getBoundingClientRect().width, 42)
- }, [time, open, layout?.pill.width])
+ if (!timer) return
+ collapsedWidth.current = 83 + timer.getBoundingClientRect().width + (muted ? 12 + 1 + 12 + 24 : 0)
+ if (!intent.pressed) window.yogurt.widget.size(collapsedWidth.current, 42)
+ }, [time, open, layout?.pill.width, muted])
useEffect(() => {
let frame = 0, lastPoint = { x: -1, y: -1 }, lastSurface = ''
const tick = (now: number) => {
@@ -86,7 +90,7 @@ export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, war
const el = card.current
if (el && el.style.visibility === 'visible') {
const r = el.getBoundingClientRect(), surface = { x: r.x, y: r.y, width: r.width, height: r.height, radius: parseFloat(getComputedStyle(el).borderRadius) }
- const p = pointer.current, inside = widgetContains(surface, p.x, p.y)
+ const p = pointer.current, inside = keyboardFocus.current || widgetContains(surface, p.x, p.y)
if (inside !== intent.over) inside ? intent.enter(now) : intent.leave(now)
else if (inside && (p.x !== lastPoint.x || p.y !== lastPoint.y)) intent.move(now)
lastPoint = p
@@ -94,7 +98,10 @@ export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, war
if (next !== null) { setOpen(next); morph.current(); resumeAt.current = null }
else if (!intent.pressed && resumeAt.current !== null && now >= resumeAt.current) { resumeAt.current = null; morph.current() }
const key = JSON.stringify(surface)
- if (key !== lastSurface) { lastSurface = key; window.yogurt.widget.surface(surface) }
+ if (key !== lastSurface) {
+ lastSurface = key; window.yogurt.widget.surface(surface)
+ if (!intent.open && !intent.pressed && surface.height === 42 && collapsedWidth.current) window.yogurt.widget.size(collapsedWidth.current, 42)
+ }
}
// Keep running only while a hover deadline is pending or the shape is moving.
if (intent.due || resumeAt.current !== null || animations.current.some(a => a.playState === 'running')) frame = requestAnimationFrame(tick)
@@ -108,6 +115,7 @@ export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, war
}, [])
return {
open,
+ focus: (focused: boolean) => { keyboardFocus.current = focused; wake.current() },
pointer: (x: number, y: number) => {
pointer.current = { x, y }
wake.current()
@@ -123,8 +131,7 @@ export function useWidgetMorph(card: React.RefObject<HTMLDivElement | null>, war
resumeAt.current = performance.now() + (dragged ? 650 : 0)
wake.current()
window.yogurt.widget.pressed(false)
- const timer = card.current?.querySelector<HTMLElement>('[data-testid="widget-time"]')
- if (timer) window.yogurt.widget.size(83 + timer.getBoundingClientRect().width, 42)
+ if (collapsedWidth.current) window.yogurt.widget.size(collapsedWidth.current, 42)
},
}
}
diff --git a/app/src/shared/liveWords.ts b/app/src/shared/liveWords.ts
index e0c7d654..f849101d 100644
--- a/app/src/shared/liveWords.ts
+++ b/app/src/shared/liveWords.ts
@@ -10,6 +10,8 @@ export type LiveWord = {
glue?: boolean
/** its time is a guess, spread over a reading that gave no time per word (Apple's volatile words) */
rough?: boolean
+ /** visible at a confirmed mute: only the final reading of this audio can replace it */
+ muteMs?: number
}
export type Heard = { startMs: number; endMs: number; text: string; words?: Array<{ text: string; startMs: number; endMs: number }> }
@@ -55,7 +57,7 @@ export const joinWords = (ws: LiveWord[]): string => ws.map((w, i) => (i === 0 |
/** the words `drop` says a new reading reads again go, its words come in; kept in time order */
export function replaceWords(cur: LiveWord[], incoming: LiveWord[], drop: (w: LiveWord) => boolean): LiveWord[] {
- return [...cur.filter((w) => !drop(w)), ...incoming].sort((a, b) => a.startMs - b.startMs)
+ return [...cur.filter((w) => w.muteMs !== undefined || !drop(w)), ...incoming].sort((a, b) => a.startMs - b.startMs)
}
const norm = (s: string) => s.toLocaleLowerCase().replace(/[^\p{L}\p{N}']/gu, '')
@@ -90,7 +92,8 @@ function covered(rough: LiveWord[], finalText: string): number {
export function afterFinal(ws: LiveWord[], f: { endMs: number; text: string }): LiveWord[] {
const exact = ws.filter((w) => !w.rough && mid(w) >= f.endMs)
const rough = ws.filter((w) => w.rough)
- const byText = covered(rough, f.text)
+ const muteMs = rough.find(w => w.muteMs !== undefined && f.endMs <= w.muteMs)?.muteMs
+ const byText = covered(muteMs === undefined ? rough : rough.filter(w => w.startMs < muteMs), f.text)
const byTime = rough.filter((w) => mid(w) < f.endMs - ROUGH_SLACK_MS).length
- return [...exact, ...rough.slice(byText || byTime)].sort((a, b) => a.startMs - b.startMs)
+ return [...exact, ...rough.slice(byText || byTime).filter(w => w.muteMs === undefined || mid(w) >= f.endMs)].sort((a, b) => a.startMs - b.startMs)
}
diff --git a/app/src/shared/locales/ar.json b/app/src/shared/locales/ar.json
index f5a58e01..5cbfe6c1 100644
--- a/app/src/shared/locales/ar.json
+++ b/app/src/shared/locales/ar.json
@@ -843,5 +843,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "يتواصل iPhone مع هذا الكمبيوتر فقط على شبكة Wi-Fi نفسها. لا شيء يمر عبر الإنترنت.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "لا يستطيع iPhone الوصول إلى هذا الكمبيوتر الآن. جرّب إعادة تشغيل Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "لا يستطيع iPhone رؤية هذا الكمبيوتر. اسمح لـ Yogurt بالشبكة المحلية في إعدادات النظام ← الخصوصية والأمن.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "لا يستطيع iPhone رؤية هذا الكمبيوتر. اسمح لـ Yogurt بالمرور عبر جدار الحماية على الشبكات الخاصة."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "لا يستطيع iPhone رؤية هذا الكمبيوتر. اسمح لـ Yogurt بالمرور عبر جدار الحماية على الشبكات الخاصة.",
+ "Mute my mic in Yogurt": "كتم الميكروفون الخاص بي في Yogurt",
+ "Mute my mic": "كتم الميكروفون الخاص بي",
+ "Mic is still off. Try again.": "لا يزال الميكروفون مكتومًا. حاول مجددًا.",
+ "Muting mic…": "جارٍ كتم الميكروفون…",
+ "Mic off in Yogurt": "الميكروفون مكتوم في Yogurt",
+ "Unmuting mic…": "جارٍ إلغاء كتم الميكروفون…",
+ "Unmute my mic": "إلغاء كتم الميكروفون الخاص بي",
+ "Mic on in Yogurt": "الميكروفون مفعّل في Yogurt",
+ "Unmute my mic in Yogurt": "إلغاء كتم الميكروفون الخاص بي في Yogurt",
+ "Mic will stay off on resume": "سيظل الميكروفون مكتومًا عند الاستئناف",
+ "Mic mute couldn’t be confirmed.": "تعذّر التأكد من كتم الميكروفون.",
+ "Mic off. Yogurt can’t hear call audio.": "الميكروفون مكتوم. لا يستطيع Yogurt سماع صوت المكالمة."
}
diff --git a/app/src/shared/locales/bn.json b/app/src/shared/locales/bn.json
index 761ffdcb..f2791c0b 100644
--- a/app/src/shared/locales/bn.json
+++ b/app/src/shared/locales/bn.json
@@ -775,5 +775,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "আপনার iPhone শুধু একই Wi-Fi-তে এই কম্পিউটারের সঙ্গে কথা বলে। কিছুই ইন্টারনেট দিয়ে যায় না।",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "আপনার iPhone এখন এই কম্পিউটারে পৌঁছাতে পারছে না। Yogurt আবার চালু করে দেখুন।",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "আপনার iPhone এই কম্পিউটারটি দেখতে পাচ্ছে না। সিস্টেম সেটিংস → গোপনীয়তা ও নিরাপত্তায় Yogurt-কে লোকাল নেটওয়ার্ক ব্যবহারের অনুমতি দিন।",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "আপনার iPhone এই কম্পিউটারটি দেখতে পাচ্ছে না। প্রাইভেট নেটওয়ার্কে আপনার ফায়ারওয়ালের মধ্য দিয়ে Yogurt-কে অনুমতি দিন।"
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "আপনার iPhone এই কম্পিউটারটি দেখতে পাচ্ছে না। প্রাইভেট নেটওয়ার্কে আপনার ফায়ারওয়ালের মধ্য দিয়ে Yogurt-কে অনুমতি দিন।",
+ "Mute my mic in Yogurt": "Yogurt-এ আমার মাইক মিউট করুন",
+ "Mute my mic": "আমার মাইক মিউট করুন",
+ "Mic is still off. Try again.": "মাইক এখনও বন্ধ আছে। আবার চেষ্টা করুন।",
+ "Muting mic…": "মাইক মিউট করা হচ্ছে…",
+ "Mic off in Yogurt": "Yogurt-এ মাইক বন্ধ",
+ "Unmuting mic…": "মাইক আনমিউট করা হচ্ছে…",
+ "Unmute my mic": "আমার মাইক আনমিউট করুন",
+ "Mic on in Yogurt": "Yogurt-এ মাইক চালু",
+ "Unmute my mic in Yogurt": "Yogurt-এ আমার মাইক আনমিউট করুন",
+ "Mic will stay off on resume": "রেকর্ডিং আবার শুরু হলে মাইক বন্ধ থাকবে",
+ "Mic mute couldn’t be confirmed.": "মাইক মিউট হয়েছে কি না নিশ্চিত করা যায়নি।",
+ "Mic off. Yogurt can’t hear call audio.": "মাইক বন্ধ। Yogurt কলের শব্দ শুনতে পাচ্ছে না।"
}
diff --git a/app/src/shared/locales/cs.json b/app/src/shared/locales/cs.json
index 90a5b8b1..39b3efe6 100644
--- a/app/src/shared/locales/cs.json
+++ b/app/src/shared/locales/cs.json
@@ -818,5 +818,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Váš iPhone komunikuje s tímto počítačem jen ve stejné síti Wi-Fi. Nic nejde přes internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Váš iPhone se teď k tomuto počítači nedostane. Zkuste Yogurt restartovat.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Váš iPhone tento počítač nevidí. Povolte Yogurtu místní síť v Nastavení systému → Soukromí a zabezpečení.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Váš iPhone tento počítač nevidí. Povolte Yogurt ve firewallu pro soukromé sítě."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Váš iPhone tento počítač nevidí. Povolte Yogurt ve firewallu pro soukromé sítě.",
+ "Mute my mic in Yogurt": "Ztlumit můj mikrofon v Yogurtu",
+ "Mute my mic": "Ztlumit můj mikrofon",
+ "Mic is still off. Try again.": "Mikrofon je stále ztlumený. Zkuste to znovu.",
+ "Muting mic…": "Ztlumování mikrofonu…",
+ "Mic off in Yogurt": "Mikrofon v Yogurtu je ztlumený",
+ "Unmuting mic…": "Zapínání mikrofonu…",
+ "Unmute my mic": "Zapnout můj mikrofon",
+ "Mic on in Yogurt": "Mikrofon v Yogurtu je zapnutý",
+ "Unmute my mic in Yogurt": "Zapnout můj mikrofon v Yogurtu",
+ "Mic will stay off on resume": "Po obnovení nahrávání zůstane mikrofon ztlumený",
+ "Mic mute couldn’t be confirmed.": "Ztlumení mikrofonu se nepodařilo potvrdit.",
+ "Mic off. Yogurt can’t hear call audio.": "Mikrofon je ztlumený. Yogurt neslyší zvuk hovoru."
}
diff --git a/app/src/shared/locales/da.json b/app/src/shared/locales/da.json
index 83069f16..19e44443 100644
--- a/app/src/shared/locales/da.json
+++ b/app/src/shared/locales/da.json
@@ -787,5 +787,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Din iPhone taler kun med denne computer på samme wi-fi. Intet går via internettet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Din iPhone kan ikke nå denne computer lige nu. Prøv at genstarte Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Din iPhone kan ikke se denne computer. Giv Yogurt adgang til lokalt netværk i Systemindstillinger → Anonymitet og sikkerhed.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Din iPhone kan ikke se denne computer. Tillad Yogurt gennem din firewall på private netværk."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Din iPhone kan ikke se denne computer. Tillad Yogurt gennem din firewall på private netværk.",
+ "Mute my mic in Yogurt": "Slå min mikrofon fra i Yogurt",
+ "Mute my mic": "Slå min mikrofon fra",
+ "Mic is still off. Try again.": "Mikrofonen er stadig slået fra. Prøv igen.",
+ "Muting mic…": "Slår mikrofonen fra…",
+ "Mic off in Yogurt": "Mikrofon slået fra i Yogurt",
+ "Unmuting mic…": "Slår mikrofonen til…",
+ "Unmute my mic": "Slå min mikrofon til",
+ "Mic on in Yogurt": "Mikrofon slået til i Yogurt",
+ "Unmute my mic in Yogurt": "Slå min mikrofon til i Yogurt",
+ "Mic will stay off on resume": "Mikrofonen forbliver slået fra, når optagelsen fortsætter",
+ "Mic mute couldn’t be confirmed.": "Det kunne ikke bekræftes, at mikrofonen er slået fra.",
+ "Mic off. Yogurt can’t hear call audio.": "Mikrofon slået fra. Yogurt kan ikke høre lyden fra opkaldet."
}
diff --git a/app/src/shared/locales/de.json b/app/src/shared/locales/de.json
index 75d738b2..e8f5f80b 100644
--- a/app/src/shared/locales/de.json
+++ b/app/src/shared/locales/de.json
@@ -787,5 +787,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Dein iPhone spricht mit diesem Computer nur im selben WLAN. Nichts geht über das Internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Dein iPhone kann diesen Computer gerade nicht erreichen. Starte Yogurt neu.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Dein iPhone sieht diesen Computer nicht. Erlaube Yogurt das lokale Netzwerk in Systemeinstellungen → Datenschutz & Sicherheit.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Dein iPhone sieht diesen Computer nicht. Lass Yogurt in deiner Firewall für private Netzwerke zu."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Dein iPhone sieht diesen Computer nicht. Lass Yogurt in deiner Firewall für private Netzwerke zu.",
+ "Mute my mic in Yogurt": "Mein Mikrofon in Yogurt stummschalten",
+ "Mute my mic": "Mein Mikrofon stummschalten",
+ "Mic is still off. Try again.": "Das Mikrofon ist noch aus. Versuche es erneut.",
+ "Muting mic…": "Mikrofon wird stummgeschaltet…",
+ "Mic off in Yogurt": "Mikrofon in Yogurt aus",
+ "Unmuting mic…": "Mikrofon wird eingeschaltet…",
+ "Unmute my mic": "Mein Mikrofon einschalten",
+ "Mic on in Yogurt": "Mikrofon in Yogurt an",
+ "Unmute my mic in Yogurt": "Mein Mikrofon in Yogurt einschalten",
+ "Mic will stay off on resume": "Das Mikrofon bleibt beim Fortsetzen aus",
+ "Mic mute couldn’t be confirmed.": "Die Stummschaltung konnte nicht bestätigt werden.",
+ "Mic off. Yogurt can’t hear call audio.": "Mikrofon aus. Yogurt empfängt keinen Ton aus dem Gespräch."
}
diff --git a/app/src/shared/locales/el.json b/app/src/shared/locales/el.json
index d727fecd..b21ea859 100644
--- a/app/src/shared/locales/el.json
+++ b/app/src/shared/locales/el.json
@@ -790,5 +790,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Το iPhone σου μιλά με αυτόν τον υπολογιστή μόνο στο ίδιο Wi-Fi. Τίποτα δεν περνά από το διαδίκτυο.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Το iPhone σου δεν μπορεί να φτάσει αυτόν τον υπολογιστή τώρα. Δοκίμασε να επανεκκινήσεις το Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Το iPhone σου δεν βλέπει αυτόν τον υπολογιστή. Επίτρεψε το Τοπικό δίκτυο για το Yogurt στις Ρυθμίσεις συστήματος → Απόρρητο και ασφάλεια.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Το iPhone σου δεν βλέπει αυτόν τον υπολογιστή. Επίτρεψε το Yogurt στο τείχος προστασίας για ιδιωτικά δίκτυα."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Το iPhone σου δεν βλέπει αυτόν τον υπολογιστή. Επίτρεψε το Yogurt στο τείχος προστασίας για ιδιωτικά δίκτυα.",
+ "Mute my mic in Yogurt": "Σίγαση του μικροφώνου μου στο Yogurt",
+ "Mute my mic": "Σίγαση του μικροφώνου μου",
+ "Mic is still off. Try again.": "Το μικρόφωνο παραμένει σε σίγαση. Δοκιμάστε ξανά.",
+ "Muting mic…": "Γίνεται σίγαση του μικροφώνου…",
+ "Mic off in Yogurt": "Μικρόφωνο σε σίγαση στο Yogurt",
+ "Unmuting mic…": "Ενεργοποίηση μικροφώνου…",
+ "Unmute my mic": "Ενεργοποίηση του μικροφώνου μου",
+ "Mic on in Yogurt": "Μικρόφωνο ενεργό στο Yogurt",
+ "Unmute my mic in Yogurt": "Ενεργοποίηση του μικροφώνου μου στο Yogurt",
+ "Mic will stay off on resume": "Το μικρόφωνο θα παραμείνει σε σίγαση κατά τη συνέχιση",
+ "Mic mute couldn’t be confirmed.": "Δεν ήταν δυνατή η επιβεβαίωση της σίγασης του μικροφώνου.",
+ "Mic off. Yogurt can’t hear call audio.": "Μικρόφωνο σε σίγαση. Το Yogurt δεν λαμβάνει τον ήχο της κλήσης."
}
diff --git a/app/src/shared/locales/en.json b/app/src/shared/locales/en.json
index 43bda1ff..3e5011a1 100644
--- a/app/src/shared/locales/en.json
+++ b/app/src/shared/locales/en.json
@@ -294,5 +294,17 @@
"Send feedback": "Send feedback",
"Help and settings": "Help and settings",
"Yogurt menu": "Yogurt menu",
- "Restart to update · {version}": "Restart to update · {version}"
+ "Restart to update · {version}": "Restart to update · {version}",
+ "Mic is still off. Try again.": "Mic is still off. Try again.",
+ "Mute my mic in Yogurt": "Mute my mic in Yogurt",
+ "Muting mic…": "Muting mic…",
+ "Mic off in Yogurt": "Mic off in Yogurt",
+ "Unmute my mic in Yogurt": "Unmute my mic in Yogurt",
+ "Unmuting mic…": "Unmuting mic…",
+ "Unmute my mic": "Unmute my mic",
+ "Mic will stay off on resume": "Mic will stay off on resume",
+ "Mute my mic": "Mute my mic",
+ "Mic on in Yogurt": "Mic on in Yogurt",
+ "Mic mute couldn’t be confirmed.": "Mic mute couldn’t be confirmed.",
+ "Mic off. Yogurt can’t hear call audio.": "Mic off. Yogurt can’t hear call audio."
}
diff --git a/app/src/shared/locales/es.json b/app/src/shared/locales/es.json
index d7ae6a14..f82c9aa0 100644
--- a/app/src/shared/locales/es.json
+++ b/app/src/shared/locales/es.json
@@ -800,5 +800,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Tu iPhone habla con este ordenador solo en la misma red Wi-Fi. Nada pasa por internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Tu iPhone no puede comunicarse con este ordenador ahora. Prueba a reiniciar Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Tu iPhone no ve este ordenador. Permite la red local para Yogurt en Ajustes del Sistema → Privacidad y seguridad.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Tu iPhone no ve este ordenador. Permite Yogurt en tu cortafuegos para redes privadas."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Tu iPhone no ve este ordenador. Permite Yogurt en tu cortafuegos para redes privadas.",
+ "Mute my mic in Yogurt": "Silenciar mi micrófono en Yogurt",
+ "Mute my mic": "Silenciar mi micrófono",
+ "Mic is still off. Try again.": "El micrófono sigue silenciado. Inténtalo de nuevo.",
+ "Muting mic…": "Silenciando el micrófono…",
+ "Mic off in Yogurt": "Micrófono silenciado en Yogurt",
+ "Unmuting mic…": "Activando el micrófono…",
+ "Unmute my mic": "Activar mi micrófono",
+ "Mic on in Yogurt": "Micrófono activo en Yogurt",
+ "Unmute my mic in Yogurt": "Activar mi micrófono en Yogurt",
+ "Mic will stay off on resume": "El micrófono seguirá silenciado al reanudar",
+ "Mic mute couldn’t be confirmed.": "No se pudo confirmar que el micrófono esté silenciado.",
+ "Mic off. Yogurt can’t hear call audio.": "Micrófono silenciado. Yogurt no puede oír el audio de la llamada."
}
diff --git a/app/src/shared/locales/fi.json b/app/src/shared/locales/fi.json
index 2ab69fbe..e462dcb3 100644
--- a/app/src/shared/locales/fi.json
+++ b/app/src/shared/locales/fi.json
@@ -793,5 +793,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhonesi puhuu tämän tietokoneen kanssa vain samassa Wi-Fi-verkossa. Mitään ei kulje internetin kautta.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhonesi ei tavoita tätä tietokonetta juuri nyt. Kokeile käynnistää Yogurt uudelleen.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhonesi ei näe tätä tietokonetta. Salli Yogurtille paikallisverkko kohdassa Järjestelmäasetukset → Tietosuoja ja turvallisuus.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhonesi ei näe tätä tietokonetta. Salli Yogurt palomuurissa yksityisissä verkoissa."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhonesi ei näe tätä tietokonetta. Salli Yogurt palomuurissa yksityisissä verkoissa.",
+ "Mute my mic in Yogurt": "Mykistä mikrofonini Yogurtissa",
+ "Mute my mic": "Mykistä mikrofonini",
+ "Mic is still off. Try again.": "Mikrofoni on edelleen mykistetty. Yritä uudelleen.",
+ "Muting mic…": "Mykistetään mikrofonia…",
+ "Mic off in Yogurt": "Mikrofoni mykistetty Yogurtissa",
+ "Unmuting mic…": "Poistetaan mikrofonin mykistystä…",
+ "Unmute my mic": "Poista mikrofonini mykistys",
+ "Mic on in Yogurt": "Mikrofoni käytössä Yogurtissa",
+ "Unmute my mic in Yogurt": "Poista mikrofonini mykistys Yogurtissa",
+ "Mic will stay off on resume": "Mikrofoni pysyy mykistettynä, kun tallennusta jatketaan",
+ "Mic mute couldn’t be confirmed.": "Mikrofonin mykistystä ei voitu vahvistaa.",
+ "Mic off. Yogurt can’t hear call audio.": "Mikrofoni on mykistetty. Yogurt ei kuule puhelun ääntä."
}
diff --git a/app/src/shared/locales/fil.json b/app/src/shared/locales/fil.json
index a7250c3b..14c130e4 100644
--- a/app/src/shared/locales/fil.json
+++ b/app/src/shared/locales/fil.json
@@ -787,5 +787,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Kausap lang ng iPhone mo ang computer na ito sa iisang Wi-Fi. Walang dumadaan sa internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Hindi maabot ng iPhone mo ang computer na ito ngayon. Subukang i-restart ang Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Hindi makita ng iPhone mo ang computer na ito. Payagan ang Local Network para sa Yogurt sa System Settings → Privacy & Security.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Hindi makita ng iPhone mo ang computer na ito. Payagan ang Yogurt sa firewall mo para sa mga private network."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Hindi makita ng iPhone mo ang computer na ito. Payagan ang Yogurt sa firewall mo para sa mga private network.",
+ "Mute my mic in Yogurt": "I-mute ang mikropono ko sa Yogurt",
+ "Mute my mic": "I-mute ang mikropono ko",
+ "Mic is still off. Try again.": "Naka-mute pa rin ang mikropono. Subukan ulit.",
+ "Muting mic…": "Minu-mute ang mikropono…",
+ "Mic off in Yogurt": "Naka-mute ang mikropono sa Yogurt",
+ "Unmuting mic…": "Ina-unmute ang mikropono…",
+ "Unmute my mic": "I-unmute ang mikropono ko",
+ "Mic on in Yogurt": "Naka-on ang mikropono sa Yogurt",
+ "Unmute my mic in Yogurt": "I-unmute ang mikropono ko sa Yogurt",
+ "Mic will stay off on resume": "Mananatiling naka-mute ang mikropono kapag ipinagpatuloy ang pag-record",
+ "Mic mute couldn’t be confirmed.": "Hindi makumpirmang naka-mute ang mikropono.",
+ "Mic off. Yogurt can’t hear call audio.": "Naka-mute ang mikropono. Hindi marinig ng Yogurt ang audio ng tawag."
}
diff --git a/app/src/shared/locales/fr.json b/app/src/shared/locales/fr.json
index ab09849a..6a408199 100644
--- a/app/src/shared/locales/fr.json
+++ b/app/src/shared/locales/fr.json
@@ -803,5 +803,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Votre iPhone ne communique avec cet ordinateur que sur le même réseau Wi-Fi. Rien ne passe par Internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Votre iPhone ne peut pas joindre cet ordinateur pour le moment. Essayez de redémarrer Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Votre iPhone ne voit pas cet ordinateur. Autorisez le réseau local pour Yogurt dans Réglages Système → Confidentialité et sécurité.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Votre iPhone ne voit pas cet ordinateur. Autorisez Yogurt dans votre pare-feu pour les réseaux privés."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Votre iPhone ne voit pas cet ordinateur. Autorisez Yogurt dans votre pare-feu pour les réseaux privés.",
+ "Mute my mic in Yogurt": "Couper mon micro dans Yogurt",
+ "Mute my mic": "Couper mon micro",
+ "Mic is still off. Try again.": "Le micro est toujours coupé. Réessayez.",
+ "Muting mic…": "Désactivation du micro…",
+ "Mic off in Yogurt": "Micro coupé dans Yogurt",
+ "Unmuting mic…": "Réactivation du micro…",
+ "Unmute my mic": "Réactiver mon micro",
+ "Mic on in Yogurt": "Micro actif dans Yogurt",
+ "Unmute my mic in Yogurt": "Réactiver mon micro dans Yogurt",
+ "Mic will stay off on resume": "Le micro restera coupé à la reprise",
+ "Mic mute couldn’t be confirmed.": "Impossible de confirmer la coupure du micro.",
+ "Mic off. Yogurt can’t hear call audio.": "Micro coupé. Yogurt ne reçoit pas le son de l’appel."
}
diff --git a/app/src/shared/locales/he.json b/app/src/shared/locales/he.json
index 87582543..1106589c 100644
--- a/app/src/shared/locales/he.json
+++ b/app/src/shared/locales/he.json
@@ -797,5 +797,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "ה-iPhone מדבר עם המחשב הזה רק באותה רשת Wi-Fi. שום דבר לא עובר דרך האינטרנט.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "ה-iPhone לא מצליח להגיע למחשב הזה כרגע. נסו להפעיל מחדש את Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "ה-iPhone לא רואה את המחשב הזה. אפשרו ל-Yogurt גישה לרשת המקומית בהגדרות המערכת ← פרטיות ואבטחה.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "ה-iPhone לא רואה את המחשב הזה. אפשרו ל-Yogurt לעבור דרך חומת האש ברשתות פרטיות."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "ה-iPhone לא רואה את המחשב הזה. אפשרו ל-Yogurt לעבור דרך חומת האש ברשתות פרטיות.",
+ "Mute my mic in Yogurt": "השתקת המיקרופון שלי ב־Yogurt",
+ "Mute my mic": "השתקת המיקרופון שלי",
+ "Mic is still off. Try again.": "המיקרופון עדיין מושתק. אפשר לנסות שוב.",
+ "Muting mic…": "משתיק את המיקרופון…",
+ "Mic off in Yogurt": "המיקרופון מושתק ב־Yogurt",
+ "Unmuting mic…": "מבטל את השתקת המיקרופון…",
+ "Unmute my mic": "ביטול השתקת המיקרופון שלי",
+ "Mic on in Yogurt": "המיקרופון פעיל ב־Yogurt",
+ "Unmute my mic in Yogurt": "ביטול השתקת המיקרופון שלי ב־Yogurt",
+ "Mic will stay off on resume": "המיקרופון יישאר מושתק כשההקלטה תתחדש",
+ "Mic mute couldn’t be confirmed.": "לא ניתן היה לאשר שהמיקרופון הושתק.",
+ "Mic off. Yogurt can’t hear call audio.": "המיקרופון מושתק. Yogurt לא קולט את שמע השיחה."
}
diff --git a/app/src/shared/locales/hi.json b/app/src/shared/locales/hi.json
index 5f5e140e..928c723c 100644
--- a/app/src/shared/locales/hi.json
+++ b/app/src/shared/locales/hi.json
@@ -775,5 +775,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "आपका iPhone इस कंप्यूटर से सिर्फ़ एक ही Wi-Fi पर बात करता है। कुछ भी इंटरनेट से नहीं जाता।",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "आपका iPhone अभी इस कंप्यूटर तक नहीं पहुँच पा रहा। Yogurt को फिर से शुरू करके देखें।",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "आपका iPhone इस कंप्यूटर को नहीं देख पा रहा। सिस्टम सेटिंग्ज़ → गोपनीयता और सुरक्षा में Yogurt को लोकल नेटवर्क की अनुमति दें।",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "आपका iPhone इस कंप्यूटर को नहीं देख पा रहा। निजी नेटवर्क पर अपने फ़ायरवॉल में Yogurt को अनुमति दें।"
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "आपका iPhone इस कंप्यूटर को नहीं देख पा रहा। निजी नेटवर्क पर अपने फ़ायरवॉल में Yogurt को अनुमति दें।",
+ "Mute my mic in Yogurt": "Yogurt में मेरा माइक म्यूट करें",
+ "Mute my mic": "मेरा माइक म्यूट करें",
+ "Mic is still off. Try again.": "माइक अभी भी बंद है। फिर कोशिश करें।",
+ "Muting mic…": "माइक म्यूट किया जा रहा है…",
+ "Mic off in Yogurt": "Yogurt में माइक बंद है",
+ "Unmuting mic…": "माइक अनम्यूट किया जा रहा है…",
+ "Unmute my mic": "मेरा माइक अनम्यूट करें",
+ "Mic on in Yogurt": "Yogurt में माइक चालू है",
+ "Unmute my mic in Yogurt": "Yogurt में मेरा माइक अनम्यूट करें",
+ "Mic will stay off on resume": "रिकॉर्डिंग फिर शुरू होने पर माइक बंद रहेगा",
+ "Mic mute couldn’t be confirmed.": "माइक म्यूट होने की पुष्टि नहीं हो सकी।",
+ "Mic off. Yogurt can’t hear call audio.": "माइक बंद है। Yogurt को कॉल की आवाज़ सुनाई नहीं दे रही है।"
}
diff --git a/app/src/shared/locales/hu.json b/app/src/shared/locales/hu.json
index 68f45bb9..3fb3cf78 100644
--- a/app/src/shared/locales/hu.json
+++ b/app/src/shared/locales/hu.json
@@ -775,5 +775,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Az iPhone-od csak ugyanazon a Wi-Fi-hálózaton beszél ezzel a számítógéppel. Semmi sem megy át az interneten.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Az iPhone-od most nem éri el ezt a számítógépet. Próbáld újraindítani a Yogurtot.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Az iPhone-od nem látja ezt a számítógépet. Engedélyezd a Yogurtnak a helyi hálózatot a Rendszerbeállítások → Adatvédelem és biztonság alatt.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Az iPhone-od nem látja ezt a számítógépet. Engedélyezd a Yogurtot a tűzfaladon a magánhálózatokon."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Az iPhone-od nem látja ezt a számítógépet. Engedélyezd a Yogurtot a tűzfaladon a magánhálózatokon.",
+ "Mute my mic in Yogurt": "Mikrofonom némítása a Yogurtban",
+ "Mute my mic": "Mikrofonom némítása",
+ "Mic is still off. Try again.": "A mikrofon továbbra is néma. Próbálja újra.",
+ "Muting mic…": "Mikrofon némítása…",
+ "Mic off in Yogurt": "Mikrofon némítva a Yogurtban",
+ "Unmuting mic…": "Mikrofon bekapcsolása…",
+ "Unmute my mic": "Mikrofonom bekapcsolása",
+ "Mic on in Yogurt": "Mikrofon bekapcsolva a Yogurtban",
+ "Unmute my mic in Yogurt": "Mikrofonom bekapcsolása a Yogurtban",
+ "Mic will stay off on resume": "Folytatáskor a mikrofon néma marad",
+ "Mic mute couldn’t be confirmed.": "Nem sikerült megerősíteni a mikrofon némítását.",
+ "Mic off. Yogurt can’t hear call audio.": "A mikrofon néma. A Yogurt nem érzékeli a hívás hangját."
}
diff --git a/app/src/shared/locales/id.json b/app/src/shared/locales/id.json
index 777defb9..359c3e4d 100644
--- a/app/src/shared/locales/id.json
+++ b/app/src/shared/locales/id.json
@@ -745,5 +745,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhone kamu hanya berbicara dengan komputer ini di Wi-Fi yang sama. Tidak ada yang lewat internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhone kamu tidak bisa menjangkau komputer ini sekarang. Coba mulai ulang Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhone kamu tidak bisa melihat komputer ini. Izinkan Jaringan Lokal untuk Yogurt di Pengaturan Sistem → Privasi & Keamanan.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone kamu tidak bisa melihat komputer ini. Izinkan Yogurt melewati firewall kamu di jaringan pribadi."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone kamu tidak bisa melihat komputer ini. Izinkan Yogurt melewati firewall kamu di jaringan pribadi.",
+ "Mute my mic in Yogurt": "Bisukan mikrofon saya di Yogurt",
+ "Mute my mic": "Bisukan mikrofon saya",
+ "Mic is still off. Try again.": "Mikrofon masih nonaktif. Coba lagi.",
+ "Muting mic…": "Membisukan mikrofon…",
+ "Mic off in Yogurt": "Mikrofon nonaktif di Yogurt",
+ "Unmuting mic…": "Mengaktifkan mikrofon…",
+ "Unmute my mic": "Aktifkan mikrofon saya",
+ "Mic on in Yogurt": "Mikrofon aktif di Yogurt",
+ "Unmute my mic in Yogurt": "Aktifkan mikrofon saya di Yogurt",
+ "Mic will stay off on resume": "Mikrofon akan tetap nonaktif saat perekaman dilanjutkan",
+ "Mic mute couldn’t be confirmed.": "Status bisu mikrofon tidak dapat dipastikan.",
+ "Mic off. Yogurt can’t hear call audio.": "Mikrofon nonaktif. Yogurt tidak dapat mendengar audio panggilan."
}
diff --git a/app/src/shared/locales/it.json b/app/src/shared/locales/it.json
index 73a844be..5dcbc65a 100644
--- a/app/src/shared/locales/it.json
+++ b/app/src/shared/locales/it.json
@@ -806,5 +806,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Il tuo iPhone parla con questo computer solo sulla stessa rete Wi-Fi. Niente passa da internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Il tuo iPhone non riesce a raggiungere questo computer ora. Prova a riavviare Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Il tuo iPhone non vede questo computer. Consenti la rete locale a Yogurt in Impostazioni di Sistema → Privacy e sicurezza.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Il tuo iPhone non vede questo computer. Consenti Yogurt nel firewall per le reti private."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Il tuo iPhone non vede questo computer. Consenti Yogurt nel firewall per le reti private.",
+ "Mute my mic in Yogurt": "Disattiva il mio microfono in Yogurt",
+ "Mute my mic": "Disattiva il mio microfono",
+ "Mic is still off. Try again.": "Il microfono è ancora disattivato. Riprova.",
+ "Muting mic…": "Disattivazione del microfono…",
+ "Mic off in Yogurt": "Microfono disattivato in Yogurt",
+ "Unmuting mic…": "Riattivazione del microfono…",
+ "Unmute my mic": "Riattiva il mio microfono",
+ "Mic on in Yogurt": "Microfono attivo in Yogurt",
+ "Unmute my mic in Yogurt": "Riattiva il mio microfono in Yogurt",
+ "Mic will stay off on resume": "Il microfono resterà disattivato alla ripresa",
+ "Mic mute couldn’t be confirmed.": "Impossibile confermare la disattivazione del microfono.",
+ "Mic off. Yogurt can’t hear call audio.": "Microfono disattivato. Yogurt non riceve l’audio della chiamata."
}
diff --git a/app/src/shared/locales/ja.json b/app/src/shared/locales/ja.json
index 0487679b..9d034e86 100644
--- a/app/src/shared/locales/ja.json
+++ b/app/src/shared/locales/ja.json
@@ -745,5 +745,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhoneは同じWi-Fi上でのみこのコンピュータと通信します。インターネットを経由するものはありません。",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhoneが今このコンピュータに接続できません。Yogurtを再起動してみてください。",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhoneからこのコンピュータが見えません。システム設定 → プライバシーとセキュリティで、Yogurtのローカルネットワークを許可してください。",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhoneからこのコンピュータが見えません。ファイアウォールで、プライベートネットワークでのYogurtの通信を許可してください。"
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhoneからこのコンピュータが見えません。ファイアウォールで、プライベートネットワークでのYogurtの通信を許可してください。",
+ "Mute my mic in Yogurt": "Yogurt で自分のマイクをミュート",
+ "Mute my mic": "自分のマイクをミュート",
+ "Mic is still off. Try again.": "マイクはまだオフです。もう一度お試しください。",
+ "Muting mic…": "マイクをミュートしています…",
+ "Mic off in Yogurt": "Yogurt のマイクはオフです",
+ "Unmuting mic…": "マイクのミュートを解除しています…",
+ "Unmute my mic": "自分のマイクのミュートを解除",
+ "Mic on in Yogurt": "Yogurt のマイクはオンです",
+ "Unmute my mic in Yogurt": "Yogurt で自分のマイクのミュートを解除",
+ "Mic will stay off on resume": "録音を再開してもマイクはオフのままです",
+ "Mic mute couldn’t be confirmed.": "マイクがミュートされたか確認できませんでした。",
+ "Mic off. Yogurt can’t hear call audio.": "マイクはオフです。Yogurt に通話音声が届いていません。"
}
diff --git a/app/src/shared/locales/ko.json b/app/src/shared/locales/ko.json
index 088ce35b..3bee3ae0 100644
--- a/app/src/shared/locales/ko.json
+++ b/app/src/shared/locales/ko.json
@@ -745,5 +745,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhone은 같은 Wi-Fi에서만 이 컴퓨터와 통신합니다. 인터넷을 거치는 것은 없습니다.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhone이 지금 이 컴퓨터에 연결할 수 없습니다. Yogurt를 다시 시작해 보세요.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhone에서 이 컴퓨터가 보이지 않습니다. 시스템 설정 → 개인정보 보호 및 보안에서 Yogurt의 로컬 네트워크를 허용하세요.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone에서 이 컴퓨터가 보이지 않습니다. 방화벽에서 개인 네트워크에 대해 Yogurt를 허용하세요."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone에서 이 컴퓨터가 보이지 않습니다. 방화벽에서 개인 네트워크에 대해 Yogurt를 허용하세요.",
+ "Mute my mic in Yogurt": "Yogurt에서 내 마이크 음소거",
+ "Mute my mic": "내 마이크 음소거",
+ "Mic is still off. Try again.": "마이크가 아직 꺼져 있습니다. 다시 시도하세요.",
+ "Muting mic…": "마이크 음소거 중…",
+ "Mic off in Yogurt": "Yogurt에서 마이크가 꺼져 있습니다",
+ "Unmuting mic…": "마이크 음소거 해제 중…",
+ "Unmute my mic": "내 마이크 음소거 해제",
+ "Mic on in Yogurt": "Yogurt에서 마이크가 켜져 있습니다",
+ "Unmute my mic in Yogurt": "Yogurt에서 내 마이크 음소거 해제",
+ "Mic will stay off on resume": "녹음을 재개해도 마이크는 꺼진 상태로 유지됩니다",
+ "Mic mute couldn’t be confirmed.": "마이크가 음소거되었는지 확인할 수 없습니다.",
+ "Mic off. Yogurt can’t hear call audio.": "마이크가 꺼져 있습니다. Yogurt에서 통화 소리를 들을 수 없습니다."
}
diff --git a/app/src/shared/locales/ms.json b/app/src/shared/locales/ms.json
index a55eb6d4..acedcce5 100644
--- a/app/src/shared/locales/ms.json
+++ b/app/src/shared/locales/ms.json
@@ -745,5 +745,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhone anda hanya bercakap dengan komputer ini pada Wi-Fi yang sama. Tiada apa-apa melalui internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhone anda tidak dapat mencapai komputer ini sekarang. Cuba mulakan semula Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhone anda tidak dapat melihat komputer ini. Benarkan Rangkaian Setempat untuk Yogurt dalam Seting Sistem → Privasi & Keselamatan.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone anda tidak dapat melihat komputer ini. Benarkan Yogurt melalui tembok api anda pada rangkaian peribadi."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone anda tidak dapat melihat komputer ini. Benarkan Yogurt melalui tembok api anda pada rangkaian peribadi.",
+ "Mute my mic in Yogurt": "Senyapkan mikrofon saya dalam Yogurt",
+ "Mute my mic": "Senyapkan mikrofon saya",
+ "Mic is still off. Try again.": "Mikrofon masih disenyapkan. Cuba lagi.",
+ "Muting mic…": "Menyenyapkan mikrofon…",
+ "Mic off in Yogurt": "Mikrofon disenyapkan dalam Yogurt",
+ "Unmuting mic…": "Mengaktifkan mikrofon…",
+ "Unmute my mic": "Aktifkan mikrofon saya",
+ "Mic on in Yogurt": "Mikrofon aktif dalam Yogurt",
+ "Unmute my mic in Yogurt": "Aktifkan mikrofon saya dalam Yogurt",
+ "Mic will stay off on resume": "Mikrofon akan kekal senyap apabila rakaman disambung",
+ "Mic mute couldn’t be confirmed.": "Mikrofon tidak dapat disahkan telah disenyapkan.",
+ "Mic off. Yogurt can’t hear call audio.": "Mikrofon disenyapkan. Yogurt tidak dapat mendengar audio panggilan."
}
diff --git a/app/src/shared/locales/nb.json b/app/src/shared/locales/nb.json
index d8d9512a..716f89b4 100644
--- a/app/src/shared/locales/nb.json
+++ b/app/src/shared/locales/nb.json
@@ -787,5 +787,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhonen din snakker bare med denne datamaskinen på samme wifi. Ingenting går via internett.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhonen din når ikke denne datamaskinen akkurat nå. Prøv å starte Yogurt på nytt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhonen din ser ikke denne datamaskinen. Gi Yogurt tilgang til lokalt nettverk i Systeminnstillinger → Personvern og sikkerhet.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhonen din ser ikke denne datamaskinen. Slipp Yogurt gjennom brannmuren på private nettverk."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhonen din ser ikke denne datamaskinen. Slipp Yogurt gjennom brannmuren på private nettverk.",
+ "Mute my mic in Yogurt": "Slå av mikrofonen min i Yogurt",
+ "Mute my mic": "Slå av mikrofonen min",
+ "Mic is still off. Try again.": "Mikrofonen er fortsatt av. Prøv igjen.",
+ "Muting mic…": "Slår av mikrofonen…",
+ "Mic off in Yogurt": "Mikrofonen er av i Yogurt",
+ "Unmuting mic…": "Slår på mikrofonen…",
+ "Unmute my mic": "Slå på mikrofonen min",
+ "Mic on in Yogurt": "Mikrofonen er på i Yogurt",
+ "Unmute my mic in Yogurt": "Slå på mikrofonen min i Yogurt",
+ "Mic will stay off on resume": "Mikrofonen forblir av når opptaket fortsetter",
+ "Mic mute couldn’t be confirmed.": "Kunne ikke bekrefte at mikrofonen er av.",
+ "Mic off. Yogurt can’t hear call audio.": "Mikrofonen er av. Yogurt får ikke lyd fra samtalen."
}
diff --git a/app/src/shared/locales/nl.json b/app/src/shared/locales/nl.json
index 6a4e9522..7b0447cc 100644
--- a/app/src/shared/locales/nl.json
+++ b/app/src/shared/locales/nl.json
@@ -787,5 +787,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Je iPhone praat alleen via hetzelfde wifi-netwerk met deze computer. Er gaat niets via internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Je iPhone kan deze computer nu niet bereiken. Probeer Yogurt opnieuw te starten.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Je iPhone ziet deze computer niet. Sta het lokale netwerk toe voor Yogurt in Systeeminstellingen → Privacy en beveiliging.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Je iPhone ziet deze computer niet. Laat Yogurt door je firewall op privénetwerken."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Je iPhone ziet deze computer niet. Laat Yogurt door je firewall op privénetwerken.",
+ "Mute my mic in Yogurt": "Mijn microfoon dempen in Yogurt",
+ "Mute my mic": "Mijn microfoon dempen",
+ "Mic is still off. Try again.": "De microfoon staat nog uit. Probeer het opnieuw.",
+ "Muting mic…": "Microfoon wordt gedempt…",
+ "Mic off in Yogurt": "Microfoon uit in Yogurt",
+ "Unmuting mic…": "Microfoon wordt aangezet…",
+ "Unmute my mic": "Mijn microfoon aanzetten",
+ "Mic on in Yogurt": "Microfoon aan in Yogurt",
+ "Unmute my mic in Yogurt": "Mijn microfoon aanzetten in Yogurt",
+ "Mic will stay off on resume": "De microfoon blijft uit bij het hervatten",
+ "Mic mute couldn’t be confirmed.": "Het dempen van de microfoon kon niet worden bevestigd.",
+ "Mic off. Yogurt can’t hear call audio.": "Microfoon uit. Yogurt ontvangt geen gespreksaudio."
}
diff --git a/app/src/shared/locales/pl.json b/app/src/shared/locales/pl.json
index 1a2ae87d..252e95f3 100644
--- a/app/src/shared/locales/pl.json
+++ b/app/src/shared/locales/pl.json
@@ -823,5 +823,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Twój iPhone łączy się z tym komputerem tylko w tej samej sieci Wi-Fi. Nic nie przechodzi przez internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Twój iPhone nie może teraz połączyć się z tym komputerem. Spróbuj uruchomić Yogurt ponownie.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Twój iPhone nie widzi tego komputera. Zezwól Yogurtowi na sieć lokalną w Ustawieniach systemowych → Prywatność i ochrona.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Twój iPhone nie widzi tego komputera. Zezwól na Yogurt w zaporze sieciowej dla sieci prywatnych."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Twój iPhone nie widzi tego komputera. Zezwól na Yogurt w zaporze sieciowej dla sieci prywatnych.",
+ "Mute my mic in Yogurt": "Wycisz mój mikrofon w Yogurt",
+ "Mute my mic": "Wycisz mój mikrofon",
+ "Mic is still off. Try again.": "Mikrofon nadal jest wyciszony. Spróbuj ponownie.",
+ "Muting mic…": "Wyciszanie mikrofonu…",
+ "Mic off in Yogurt": "Mikrofon wyciszony w Yogurt",
+ "Unmuting mic…": "Włączanie mikrofonu…",
+ "Unmute my mic": "Włącz mój mikrofon",
+ "Mic on in Yogurt": "Mikrofon włączony w Yogurt",
+ "Unmute my mic in Yogurt": "Włącz mój mikrofon w Yogurt",
+ "Mic will stay off on resume": "Po wznowieniu mikrofon pozostanie wyciszony",
+ "Mic mute couldn’t be confirmed.": "Nie udało się potwierdzić wyciszenia mikrofonu.",
+ "Mic off. Yogurt can’t hear call audio.": "Mikrofon wyciszony. Yogurt nie odbiera dźwięku rozmowy."
}
diff --git a/app/src/shared/locales/pt-BR.json b/app/src/shared/locales/pt-BR.json
index f46ccf56..ccfbedf3 100644
--- a/app/src/shared/locales/pt-BR.json
+++ b/app/src/shared/locales/pt-BR.json
@@ -803,5 +803,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Seu iPhone fala com este computador só na mesma rede Wi-Fi. Nada passa pela internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Seu iPhone não consegue falar com este computador agora. Tente reiniciar o Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Seu iPhone não vê este computador. Permita a Rede Local para o Yogurt em Ajustes do Sistema → Privacidade e Segurança.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Seu iPhone não vê este computador. Permita o Yogurt no seu firewall em redes privadas."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Seu iPhone não vê este computador. Permita o Yogurt no seu firewall em redes privadas.",
+ "Mute my mic in Yogurt": "Silenciar meu microfone no Yogurt",
+ "Mute my mic": "Silenciar meu microfone",
+ "Mic is still off. Try again.": "O microfone continua silenciado. Tente novamente.",
+ "Muting mic…": "Silenciando o microfone…",
+ "Mic off in Yogurt": "Microfone silenciado no Yogurt",
+ "Unmuting mic…": "Ativando o microfone…",
+ "Unmute my mic": "Ativar meu microfone",
+ "Mic on in Yogurt": "Microfone ativo no Yogurt",
+ "Unmute my mic in Yogurt": "Ativar meu microfone no Yogurt",
+ "Mic will stay off on resume": "O microfone continuará silenciado ao retomar",
+ "Mic mute couldn’t be confirmed.": "Não foi possível confirmar se o microfone foi silenciado.",
+ "Mic off. Yogurt can’t hear call audio.": "Microfone silenciado. O Yogurt não consegue ouvir o áudio da chamada."
}
diff --git a/app/src/shared/locales/ro.json b/app/src/shared/locales/ro.json
index bc9f1451..f5a73e86 100644
--- a/app/src/shared/locales/ro.json
+++ b/app/src/shared/locales/ro.json
@@ -804,5 +804,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhone-ul tău vorbește cu acest computer doar în aceeași rețea Wi-Fi. Nimic nu trece prin internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhone-ul tău nu poate ajunge acum la acest computer. Încearcă să repornești Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhone-ul tău nu vede acest computer. Permite rețeaua locală pentru Yogurt în Configurări sistem → Confidențialitate și securitate.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone-ul tău nu vede acest computer. Permite Yogurt în firewall pentru rețelele private."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone-ul tău nu vede acest computer. Permite Yogurt în firewall pentru rețelele private.",
+ "Mute my mic in Yogurt": "Oprește-mi microfonul în Yogurt",
+ "Mute my mic": "Oprește-mi microfonul",
+ "Mic is still off. Try again.": "Microfonul este încă oprit. Încearcă din nou.",
+ "Muting mic…": "Se oprește microfonul…",
+ "Mic off in Yogurt": "Microfon oprit în Yogurt",
+ "Unmuting mic…": "Se pornește microfonul…",
+ "Unmute my mic": "Pornește-mi microfonul",
+ "Mic on in Yogurt": "Microfon pornit în Yogurt",
+ "Unmute my mic in Yogurt": "Pornește-mi microfonul în Yogurt",
+ "Mic will stay off on resume": "Microfonul va rămâne oprit la reluare",
+ "Mic mute couldn’t be confirmed.": "Oprirea microfonului nu a putut fi confirmată.",
+ "Mic off. Yogurt can’t hear call audio.": "Microfon oprit. Yogurt nu poate auzi sunetul apelului."
}
diff --git a/app/src/shared/locales/ru.json b/app/src/shared/locales/ru.json
index b0f160ec..c0a666b4 100644
--- a/app/src/shared/locales/ru.json
+++ b/app/src/shared/locales/ru.json
@@ -815,5 +815,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhone связывается с этим компьютером только в одной сети Wi-Fi. Ничего не идёт через интернет.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhone сейчас не может связаться с этим компьютером. Попробуйте перезапустить Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhone не видит этот компьютер. Разрешите Yogurt доступ к локальной сети в Системных настройках → Конфиденциальность и безопасность.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone не видит этот компьютер. Разрешите Yogurt в брандмауэре для частных сетей."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone не видит этот компьютер. Разрешите Yogurt в брандмауэре для частных сетей.",
+ "Mute my mic in Yogurt": "Выключить мой микрофон в Yogurt",
+ "Mute my mic": "Выключить мой микрофон",
+ "Mic is still off. Try again.": "Микрофон по-прежнему выключен. Попробуйте ещё раз.",
+ "Muting mic…": "Выключение микрофона…",
+ "Mic off in Yogurt": "Микрофон выключен в Yogurt",
+ "Unmuting mic…": "Включение микрофона…",
+ "Unmute my mic": "Включить мой микрофон",
+ "Mic on in Yogurt": "Микрофон включён в Yogurt",
+ "Unmute my mic in Yogurt": "Включить мой микрофон в Yogurt",
+ "Mic will stay off on resume": "При возобновлении записи микрофон останется выключенным",
+ "Mic mute couldn’t be confirmed.": "Не удалось подтвердить отключение микрофона.",
+ "Mic off. Yogurt can’t hear call audio.": "Микрофон выключен. Yogurt не слышит звук звонка."
}
diff --git a/app/src/shared/locales/sv.json b/app/src/shared/locales/sv.json
index 4c17de16..2104c2e2 100644
--- a/app/src/shared/locales/sv.json
+++ b/app/src/shared/locales/sv.json
@@ -787,5 +787,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "Din iPhone pratar bara med den här datorn på samma wifi. Inget går via internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "Din iPhone når inte den här datorn just nu. Testa att starta om Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "Din iPhone ser inte den här datorn. Tillåt lokalt nätverk för Yogurt i Systeminställningar → Integritet och säkerhet.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Din iPhone ser inte den här datorn. Släpp igenom Yogurt i brandväggen på privata nätverk."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "Din iPhone ser inte den här datorn. Släpp igenom Yogurt i brandväggen på privata nätverk.",
+ "Mute my mic in Yogurt": "Stäng av min mikrofon i Yogurt",
+ "Mute my mic": "Stäng av min mikrofon",
+ "Mic is still off. Try again.": "Mikrofonen är fortfarande av. Försök igen.",
+ "Muting mic…": "Stänger av mikrofonen…",
+ "Mic off in Yogurt": "Mikrofonen är av i Yogurt",
+ "Unmuting mic…": "Slår på mikrofonen…",
+ "Unmute my mic": "Slå på min mikrofon",
+ "Mic on in Yogurt": "Mikrofonen är på i Yogurt",
+ "Unmute my mic in Yogurt": "Slå på min mikrofon i Yogurt",
+ "Mic will stay off on resume": "Mikrofonen förblir avstängd när inspelningen återupptas",
+ "Mic mute couldn’t be confirmed.": "Det gick inte att bekräfta att mikrofonen stängts av.",
+ "Mic off. Yogurt can’t hear call audio.": "Mikrofonen är av. Yogurt kan inte höra samtalsljudet."
}
diff --git a/app/src/shared/locales/th.json b/app/src/shared/locales/th.json
index c4365ca8..2f58c38c 100644
--- a/app/src/shared/locales/th.json
+++ b/app/src/shared/locales/th.json
@@ -745,5 +745,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhone จะคุยกับคอมพิวเตอร์เครื่องนี้ผ่าน Wi-Fi เดียวกันเท่านั้น ไม่มีอะไรผ่านอินเทอร์เน็ต",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhone ของคุณเชื่อมต่อกับคอมพิวเตอร์เครื่องนี้ไม่ได้ในตอนนี้ ลองเปิด Yogurt ใหม่",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhone ของคุณมองไม่เห็นคอมพิวเตอร์เครื่องนี้ อนุญาตเครือข่ายเฉพาะที่ให้ Yogurt ในการตั้งค่าระบบ → ความเป็นส่วนตัวและความปลอดภัย",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone ของคุณมองไม่เห็นคอมพิวเตอร์เครื่องนี้ อนุญาตให้ Yogurt ผ่านไฟร์วอลล์ของคุณบนเครือข่ายส่วนตัว"
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone ของคุณมองไม่เห็นคอมพิวเตอร์เครื่องนี้ อนุญาตให้ Yogurt ผ่านไฟร์วอลล์ของคุณบนเครือข่ายส่วนตัว",
+ "Mute my mic in Yogurt": "ปิดไมค์ของฉันใน Yogurt",
+ "Mute my mic": "ปิดไมค์ของฉัน",
+ "Mic is still off. Try again.": "ไมค์ยังปิดอยู่ ลองอีกครั้ง",
+ "Muting mic…": "กำลังปิดไมค์…",
+ "Mic off in Yogurt": "ปิดไมค์ใน Yogurt แล้ว",
+ "Unmuting mic…": "กำลังเปิดไมค์…",
+ "Unmute my mic": "เปิดไมค์ของฉัน",
+ "Mic on in Yogurt": "เปิดไมค์ใน Yogurt แล้ว",
+ "Unmute my mic in Yogurt": "เปิดไมค์ของฉันใน Yogurt",
+ "Mic will stay off on resume": "ไมค์จะยังปิดอยู่เมื่อบันทึกต่อ",
+ "Mic mute couldn’t be confirmed.": "ยืนยันไม่ได้ว่าปิดไมค์แล้ว",
+ "Mic off. Yogurt can’t hear call audio.": "ไมค์ปิดอยู่ Yogurt ไม่ได้ยินเสียงการโทร"
}
diff --git a/app/src/shared/locales/tr.json b/app/src/shared/locales/tr.json
index 4859bb5d..af75f659 100644
--- a/app/src/shared/locales/tr.json
+++ b/app/src/shared/locales/tr.json
@@ -775,5 +775,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhone’un bu bilgisayarla yalnızca aynı Wi-Fi ağında konuşur. Hiçbir şey internetten geçmez.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhone’un şu anda bu bilgisayara ulaşamıyor. Yogurt’u yeniden başlatmayı dene.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhone’un bu bilgisayarı göremiyor. Sistem Ayarları → Gizlilik ve Güvenlik’te Yogurt için Yerel Ağ’a izin ver.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone’un bu bilgisayarı göremiyor. Güvenlik duvarında özel ağlar için Yogurt’a izin ver."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone’un bu bilgisayarı göremiyor. Güvenlik duvarında özel ağlar için Yogurt’a izin ver.",
+ "Mute my mic in Yogurt": "Yogurt’ta mikrofonumu sessize al",
+ "Mute my mic": "Mikrofonumu sessize al",
+ "Mic is still off. Try again.": "Mikrofon hâlâ kapalı. Tekrar deneyin.",
+ "Muting mic…": "Mikrofon sessize alınıyor…",
+ "Mic off in Yogurt": "Yogurt’ta mikrofon kapalı",
+ "Unmuting mic…": "Mikrofon açılıyor…",
+ "Unmute my mic": "Mikrofonumu aç",
+ "Mic on in Yogurt": "Yogurt’ta mikrofon açık",
+ "Unmute my mic in Yogurt": "Yogurt’ta mikrofonumu aç",
+ "Mic will stay off on resume": "Kayıt devam ettiğinde mikrofon kapalı kalacak",
+ "Mic mute couldn’t be confirmed.": "Mikrofonun sessize alındığı doğrulanamadı.",
+ "Mic off. Yogurt can’t hear call audio.": "Mikrofon kapalı. Yogurt aramanın sesini alamıyor."
}
diff --git a/app/src/shared/locales/uk.json b/app/src/shared/locales/uk.json
index d996fdbd..82f0a9c8 100644
--- a/app/src/shared/locales/uk.json
+++ b/app/src/shared/locales/uk.json
@@ -815,5 +815,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhone спілкується з цим комп’ютером лише в тій самій мережі Wi-Fi. Нічого не йде через інтернет.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhone зараз не може зв’язатися з цим комп’ютером. Спробуйте перезапустити Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhone не бачить цей комп’ютер. Дозвольте Yogurt доступ до локальної мережі в Системних параметрах → Приватність і безпека.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone не бачить цей комп’ютер. Дозвольте Yogurt у брандмауері для приватних мереж."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone не бачить цей комп’ютер. Дозвольте Yogurt у брандмауері для приватних мереж.",
+ "Mute my mic in Yogurt": "Вимкнути мій мікрофон у Yogurt",
+ "Mute my mic": "Вимкнути мій мікрофон",
+ "Mic is still off. Try again.": "Мікрофон досі вимкнено. Спробуйте ще раз.",
+ "Muting mic…": "Вимкнення мікрофона…",
+ "Mic off in Yogurt": "Мікрофон вимкнено в Yogurt",
+ "Unmuting mic…": "Увімкнення мікрофона…",
+ "Unmute my mic": "Увімкнути мій мікрофон",
+ "Mic on in Yogurt": "Мікрофон увімкнено в Yogurt",
+ "Unmute my mic in Yogurt": "Увімкнути мій мікрофон у Yogurt",
+ "Mic will stay off on resume": "Після відновлення запису мікрофон залишиться вимкненим",
+ "Mic mute couldn’t be confirmed.": "Не вдалося підтвердити вимкнення мікрофона.",
+ "Mic off. Yogurt can’t hear call audio.": "Мікрофон вимкнено. Yogurt не чує звуку дзвінка."
}
diff --git a/app/src/shared/locales/vi.json b/app/src/shared/locales/vi.json
index d4e41fd0..9dce6841 100644
--- a/app/src/shared/locales/vi.json
+++ b/app/src/shared/locales/vi.json
@@ -745,5 +745,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "iPhone chỉ trò chuyện với máy tính này trên cùng mạng Wi-Fi. Không có gì đi qua internet.",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "iPhone hiện không kết nối được với máy tính này. Hãy thử khởi động lại Yogurt.",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "iPhone không thấy máy tính này. Hãy cho phép Mạng cục bộ cho Yogurt trong Cài đặt hệ thống → Quyền riêng tư & Bảo mật.",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone không thấy máy tính này. Hãy cho phép Yogurt qua tường lửa trên mạng riêng."
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "iPhone không thấy máy tính này. Hãy cho phép Yogurt qua tường lửa trên mạng riêng.",
+ "Mute my mic in Yogurt": "Tắt micrô của tôi trong Yogurt",
+ "Mute my mic": "Tắt micrô của tôi",
+ "Mic is still off. Try again.": "Micrô vẫn đang tắt. Hãy thử lại.",
+ "Muting mic…": "Đang tắt micrô…",
+ "Mic off in Yogurt": "Micrô đã tắt trong Yogurt",
+ "Unmuting mic…": "Đang bật micrô…",
+ "Unmute my mic": "Bật micrô của tôi",
+ "Mic on in Yogurt": "Micrô đang bật trong Yogurt",
+ "Unmute my mic in Yogurt": "Bật micrô của tôi trong Yogurt",
+ "Mic will stay off on resume": "Micrô sẽ vẫn tắt khi tiếp tục ghi âm",
+ "Mic mute couldn’t be confirmed.": "Không thể xác nhận micrô đã tắt.",
+ "Mic off. Yogurt can’t hear call audio.": "Micrô đã tắt. Yogurt không nghe được âm thanh cuộc gọi."
}
diff --git a/app/src/shared/locales/zh-CN.json b/app/src/shared/locales/zh-CN.json
index fe3ab98d..ac78288f 100644
--- a/app/src/shared/locales/zh-CN.json
+++ b/app/src/shared/locales/zh-CN.json
@@ -745,5 +745,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "你的 iPhone 只在同一 Wi-Fi 下与这台电脑通信。任何内容都不经过互联网。",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "你的 iPhone 现在无法连接这台电脑。请尝试重新启动 Yogurt。",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "你的 iPhone 看不到这台电脑。请在“系统设置”→“隐私与安全性”中允许 Yogurt 使用本地网络。",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "你的 iPhone 看不到这台电脑。请在防火墙中允许 Yogurt 在专用网络上通信。"
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "你的 iPhone 看不到这台电脑。请在防火墙中允许 Yogurt 在专用网络上通信。",
+ "Mute my mic in Yogurt": "在 Yogurt 中将我的麦克风静音",
+ "Mute my mic": "将我的麦克风静音",
+ "Mic is still off. Try again.": "麦克风仍处于静音状态。请重试。",
+ "Muting mic…": "正在将麦克风静音…",
+ "Mic off in Yogurt": "Yogurt 中的麦克风已关闭",
+ "Unmuting mic…": "正在取消麦克风静音…",
+ "Unmute my mic": "取消我的麦克风静音",
+ "Mic on in Yogurt": "Yogurt 中的麦克风已开启",
+ "Unmute my mic in Yogurt": "在 Yogurt 中取消我的麦克风静音",
+ "Mic will stay off on resume": "继续录制后麦克风将保持静音",
+ "Mic mute couldn’t be confirmed.": "无法确认麦克风是否已静音。",
+ "Mic off. Yogurt can’t hear call audio.": "麦克风已关闭。Yogurt 无法接收通话音频。"
}
diff --git a/app/src/shared/locales/zh-TW.json b/app/src/shared/locales/zh-TW.json
index 74594b81..0c624cde 100644
--- a/app/src/shared/locales/zh-TW.json
+++ b/app/src/shared/locales/zh-TW.json
@@ -745,5 +745,17 @@
"Your iPhone talks to this computer only on the same Wi-Fi. Nothing goes through the internet.": "你的 iPhone 只在同一 Wi-Fi 下與這台電腦通訊。任何內容都不經過網際網路。",
"Your iPhone can't reach this computer right now. Try restarting Yogurt.": "你的 iPhone 現在無法連線這台電腦。請試著重新啟動 Yogurt。",
"Your iPhone can't see this computer. Allow Local Network for Yogurt in System Settings → Privacy & Security.": "你的 iPhone 看不到這台電腦。請在「系統設定」→「隱私權與安全性」中允許 Yogurt 使用本地網路。",
- "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "你的 iPhone 看不到這台電腦。請在防火牆中允許 Yogurt 在私人網路上通訊。"
+ "Your iPhone can't see this computer. Allow Yogurt through your firewall on private networks.": "你的 iPhone 看不到這台電腦。請在防火牆中允許 Yogurt 在私人網路上通訊。",
+ "Mute my mic in Yogurt": "在 Yogurt 中將我的麥克風靜音",
+ "Mute my mic": "將我的麥克風靜音",
+ "Mic is still off. Try again.": "麥克風仍為靜音。請再試一次。",
+ "Muting mic…": "正在將麥克風靜音…",
+ "Mic off in Yogurt": "Yogurt 中的麥克風已關閉",
+ "Unmuting mic…": "正在解除麥克風靜音…",
+ "Unmute my mic": "解除我的麥克風靜音",
+ "Mic on in Yogurt": "Yogurt 中的麥克風已開啟",
+ "Unmute my mic in Yogurt": "在 Yogurt 中解除我的麥克風靜音",
+ "Mic will stay off on resume": "繼續錄製後麥克風會保持靜音",
+ "Mic mute couldn’t be confirmed.": "無法確認麥克風是否已靜音。",
+ "Mic off. Yogurt can’t hear call audio.": "麥克風已關閉。Yogurt 無法接收通話音訊。"
}
diff --git a/app/src/shared/speechWave.ts b/app/src/shared/speechWave.ts
index 4180e6ce..72703cb8 100644
--- a/app/src/shared/speechWave.ts
+++ b/app/src/shared/speechWave.ts
@@ -37,6 +37,13 @@ export function speechSample(previous: SpeechAnchor, input: { me: number; them:
return { ...speechAt(previous, now), at: now, speaking: db >= Math.max(-44.4, floor + 10) || (held && db > Math.max(-49.2, floor + 6)) }
}
+/** The two recording waves share a source and its own noise floor. */
+export function recordingSpeech(previous: SpeechAnchor, levels: { me: number; them: number }, floors: { me: number[]; them: number[] }, muted: boolean, now: number) {
+ const source = muted ? 'them' : 'me'
+ const input = { me: levels[source], them: 0 }
+ return speechSample(previous, input, now, micFloor(floors[source], input))
+}
+
export function speechBars({ drive, phase }: ReturnType<typeof speechAt>, reduced: boolean, restOpacity = REST_OPACITY) {
const energy = drive * drive * (3 - 2 * drive)
// The captured crest is 48 px tall and the trough 14 px. Our 3 px resting stub supplies part of that trough.
diff --git a/app/src/shared/transcript.ts b/app/src/shared/transcript.ts
index 8b9fd800..4b73b391 100644
--- a/app/src/shared/transcript.ts
+++ b/app/src/shared/transcript.ts
@@ -39,6 +39,11 @@ export function turns<L extends Pick<Said, 'track' | 'startMs' | 'speaker'> & {
return out
}
+/** A final can correct its own start time. Anchor the row to the line before it. */
+export function transcriptRowKey(track: Said['track'], previous?: Pick<Said, 'track' | 'startMs'>): string {
+ return previous ? `${track}-after-${previous.track}:${previous.startMs}` : track
+}
+
/** The index of the last line that started by ms (lines sorted by start), -1 for none: a binary search, for long meetings */
export function lineAt(lines: Array<{ startMs: number }>, ms: number): number {
let lo = 0, hi = lines.length - 1, found = -1
diff --git a/app/src/shared/types.ts b/app/src/shared/types.ts
index c043aa13..9e17c66a 100644
--- a/app/src/shared/types.ts
+++ b/app/src/shared/types.ts
@@ -95,6 +95,7 @@ export type YogurtApi = {
stop(id: string): void
/** pauses or resumes this active recording without finishing the note */
setPaused(id: string, paused: boolean): Promise<boolean>
+ setMicMuted(id: string, muted: boolean): Promise<boolean>
/** retries saving the original stop time without stopping or finalizing the capture again */
retryStopSave(id: string): Promise<boolean>
/** the person's own title (tidied; blank keeps the old one) */
@@ -442,7 +443,12 @@ export type MicDevice = { id: string; name: string; isDefault: boolean }
export type MicsView = { devices: MicDevice[]; choice: string | null; using: string | null; defaultName: string | null }
/** What the recording widget shows: recording (time, hints) or the card after stopping */
+export type MicState = 'on' | 'muting' | 'off' | 'unmuting' | 'still-off' | 'unconfirmed' | 'restoring-off'
+export const micIsOff = (state?: MicState) => state === 'off' || state === 'still-off' || state === 'unmuting' || state === 'restoring-off'
+export const micPendingAction = (state?: MicState) => state === 'restoring-off' ? 'muting' : state === 'muting' || state === 'unmuting' ? state : undefined
+
export type WidgetView = {
+ micState?: MicState
kind: 'recording' | 'captured'
paused?: true
meetingId: string
diff --git a/app/test/capture.test.ts b/app/test/capture.test.ts
index 6bdae642..21a8ac45 100644
--- a/app/test/capture.test.ts
+++ b/app/test/capture.test.ts
@@ -4,8 +4,9 @@ import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'nod
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { afterEach, describe, expect, it, vi } from 'vitest'
-import { Capture, captureArgs, foldersToJoin, hookCapture, recordingBusy, recordingFinished, recordingPaused, recordingSettled, rejoinInterrupted, setRecordingPaused, settleRecording, encodeFrame, FrameParser, type CaptureOpts, type CaptureProc, type Frame } from '../src/main/capture'
-import { fakeAudioDuration, fakeCaptureProc, joinFakeParts } from '../src/main/fakeCapture'
+import { Capture, captureArgs, foldersToJoin, hookCapture, recordingBusy, recordingFinished, recordingPaused, recordingSettled, rejoinInterrupted, onRecordingEvent, setMicMuted, setRecordingPaused, settleRecording, encodeFrame, FrameParser, type CaptureOpts, type CaptureProc, type Frame } from '../src/main/capture'
+import { fakeAudioDuration, fakeCaptureProc, joinFakeParts, readWav, wavOf } from '../src/main/fakeCapture'
+import { feedRecording, wavDecode } from '../src/main/asr/backfill'
import { fakeMicList, setFakeMics } from '../src/main/fake'
import { openStore } from '../src/main/store'
@@ -140,6 +141,50 @@ describe('fake capture', () => {
await c.stop()
})
+ it('saves silence at the confirmed boundaries, with continuous call PCM and speech through Stop', async () => {
+ dir = mkdtempSync(join(tmpdir(), 'yogurt-cap-muted-'))
+ const clock = vi.spyOn(Date, 'now').mockReturnValue(0)
+ try {
+ const c = new Capture(fakeCaptureProc(dir, 0, { speech: true }))
+ const acks: number[] = [], mine: Array<[number, number]> = [], theirs: number[] = [], speech: string[] = []
+ c.on('mic-muted', ack => acks.push(ack.ms))
+ c.on('pcm', (track, ms, samples) => {
+ if (track === 'me') mine.push([ms, ms + samples.length / 16])
+ else theirs.push(samples.length)
+ })
+ c.on('speech', f => { if (f.final) speech.push(f.track) })
+ clock.mockReturnValue(2000); c.setMicMuted(true, 1)
+ clock.mockReturnValue(2050); c.setMic('BuiltInMicrophoneDevice'); c.setMicMuted(false, 2)
+ clock.mockReturnValue(3000); c.setMicMuted(true, 3)
+ clock.mockReturnValue(9500); await c.stop()
+ expect(acks).toEqual([2000, 2050, 3000])
+ expect(mine.every(([a,b]) => b <= 2000 || (a >= 2050 && b <= 3000))).toBe(true)
+ expect(theirs.reduce((a,b) => a + b, 0)).toBe(9500 * 16)
+ expect(speech).toEqual(['them'])
+ // Re-transcription decodes the saved tracks in 100 ms pieces, including the 50 ms cut inside one piece.
+ const heard = { me: [] as number[], them: [] as number[] }
+ const duration = await feedRecording({
+ tracks: { me: wavDecode(join(dir, 'me.wav')), them: wavDecode(join(dir, 'them.wav')) },
+ backlogMs: () => 0,
+ push: (track, ms, samples) => {
+ if (samples.some(x => x !== 0)) heard[track].push(ms)
+ if (track === 'me' && ms === 2000) expect(samples.subarray(0, 50 * 16).every(x => x === 0)).toBe(true)
+ },
+ })
+ expect(duration).toBe(9500)
+ expect(heard.me.some(ms => ms >= 3000)).toBe(false)
+ expect(heard.them.some(ms => ms >= 3000)).toBe(true)
+ for (const track of ['me', 'them']) {
+ const original = readWav(join(__dirname, '../e2e/fixtures', 'meeting-' + track + '.wav')).slice(0, 9500 * 16)
+ if (track === 'me') {
+ expect(original.subarray(2000 * 16, 2050 * 16).some(x => x !== 0)).toBe(true)
+ original.fill(0, 2000 * 16, 2050 * 16); original.fill(0, 3000 * 16)
+ }
+ expect(readFileSync(join(dir, track + '.wav')).equals(wavOf([original]))).toBe(true)
+ }
+ } finally { clock.mockRestore() }
+ })
+
it('append parts preserve the complete original PCM prefix and carry forward timeline after reopening', async () => {
dir = mkdtempSync(join(tmpdir(), 'yogurt-cap-append-'))
const first = new Capture(fakeCaptureProc(dir))
@@ -300,6 +345,114 @@ describe('restart after a crash', () => {
return { starts, procs, joined, stopped, begin: (id: string) => startFn({ id }), stop: (id: string) => stopFn({ id }) }
}
+ it('sends one command per transition when both controls repeat clicks, including during the pending notification', async () => {
+ const r = rig(), states: string[] = []
+ const info = vi.spyOn(console, 'info').mockImplementation(() => {})
+ const off = onRecordingEvent(event => {
+ if (event.t !== 'mic-state') return
+ states.push(event.state)
+ if (event.state === 'muting' || event.state === 'unmuting') {
+ for (let i = 0; i < 3; i++) {
+ setMicMuted('meeting', true)
+ setMicMuted('meeting', false)
+ }
+ }
+ })
+ try {
+ r.begin('meeting')
+ for (const [request, muted] of [[1, true], [2, false]] as const) {
+ setMicMuted('meeting', muted, 'widget')
+ const reply = encodeFrame({ t: 'mic-muted', id: request, muted, ms: 100 * request })
+ r.procs[0].out.write(reply)
+ r.procs[0].out.write(reply)
+ setMicMuted('meeting', muted)
+ }
+ expect(states).toEqual(['muting', 'off', 'unmuting', 'on'])
+ expect(r.procs[0].commands).toEqual(['mute 1', 'unmute 2'])
+ for (const [index, action] of ['mute', 'unmute'].entries()) {
+ expect(info).toHaveBeenCalledWith(expect.stringContaining(`MIC ${action} requested meeting=meeting request=${index + 1} source=widget`))
+ expect(info).toHaveBeenCalledWith(expect.stringMatching(new RegExp(`MIC ${action} confirmed meeting=meeting request=${index + 1} durationMs=[0-9]+`)))
+ }
+ setMicMuted('meeting', true)
+ r.procs[0].out.write(encodeFrame({ t: 'mic-muted', id: 3, muted: false, ms: 300 }))
+ expect(info).toHaveBeenCalledWith(expect.stringMatching(/MIC mute failed meeting=meeting request=3 durationMs=\d+ reason=mute-refused/))
+ } finally { off(); r.stop('meeting'); r.procs[0].exit(0); await recordingFinished('meeting'); info.mockRestore() }
+ })
+
+ it('serializes both controls, checks replies, and starts each recording with its mic on', async () => {
+ const r = rig(), states: string[] = []
+ const off = onRecordingEvent(e => { if (e.t === 'mic-state') states.push(e.state) })
+ try {
+ r.begin('meeting')
+ const reply = (id: number, muted: boolean) => r.procs[0].out.write(encodeFrame({ t: 'mic-muted', id, ms: 120, muted }))
+ expect(setMicMuted('other', true)).toBe(false)
+ expect(setMicMuted('meeting', true)).toBe(true)
+ expect(setMicMuted('meeting', true)).toBe(true)
+ expect(setMicMuted('meeting', false)).toBe(false)
+ reply(9, true)
+ expect(states).toEqual(['muting'])
+ reply(1, true)
+ expect(setRecordingPaused('meeting', true)).toBe(true)
+ expect(setMicMuted('meeting', false)).toBe(false)
+ expect(setRecordingPaused('meeting', false)).toBe(true)
+ setMicMuted('meeting', false); reply(2, true)
+ setMicMuted('meeting', false); reply(3, false)
+ expect(states).toEqual(['muting', 'off', 'unmuting', 'still-off', 'unmuting', 'on'])
+ expect(r.procs[0].commands).toEqual(['mute 1', 'pause', 'resume', 'unmute 2', 'unmute 3'])
+ setMicMuted('meeting', true); reply(4, true)
+ setMicMuted('meeting', false)
+ r.stop('meeting'); reply(5, false); r.procs[0].exit(0)
+ await recordingFinished('meeting')
+ expect(states.at(-1)).toBe('unmuting')
+ r.begin('meeting')
+ expect(r.starts[1].opts).toBeUndefined()
+ expect(setMicMuted('meeting', false)).toBe(true)
+ expect(r.procs[1].commands).toEqual([])
+ r.stop('meeting'); r.procs[1].exit(0)
+ await recordingFinished('meeting')
+ } finally { off() }
+ })
+
+ it.each(['muting', 'off', 'unmuting'])('restarts from silence after the helper dies while %s', async (state) => {
+ const r = rig(), states: string[] = []
+ const off = onRecordingEvent(e => { if (e.t === 'mic-state') states.push(e.state) })
+ try {
+ r.begin('meeting'); setMicMuted('meeting', true)
+ const ack = (proc: number, id: number, muted: boolean) => r.procs[proc].out.write(encodeFrame({ t: 'mic-muted', id, ms: 200, muted }))
+ if (state !== 'muting') ack(0, 1, true)
+ if (state === 'unmuting') setMicMuted('meeting', false)
+ r.procs[0].exit(null, 'SIGKILL')
+ expect(captureArgs('folder', r.starts[1].opts)).toContain('--mic-muted')
+ const id = state === 'unmuting' ? 3 : 2
+ expect(r.procs[1].commands).toEqual(['mute ' + id])
+ ack(0, id, true)
+ expect(states.at(-1)).toBe(state === 'muting' ? 'muting' : 'restoring-off')
+ ack(1, id, true)
+ expect(states.at(-1)).toBe('off')
+ r.stop('meeting'); r.procs[1].exit(0)
+ await recordingFinished('meeting')
+ } finally { off() }
+ })
+
+ it('stops on a missing acknowledgment and waits for exit before ending the meeting', async () => {
+ vi.useFakeTimers()
+ const r = rig(), states: string[] = []
+ const off = onRecordingEvent(e => { if (e.t === 'mic-state') states.push(e.state) })
+ try {
+ r.begin('meeting'); setMicMuted('meeting', true)
+ vi.advanceTimersByTime(5000)
+ expect(states).toEqual(['muting', 'unconfirmed'])
+ expect(r.procs[0].commands).toEqual(['mute 1', 'stop'])
+ r.procs[0].out.write(encodeFrame({ t: 'mic-muted', id: 1, ms: 12, muted: true }))
+ expect(states.at(-1)).toBe('unconfirmed')
+ expect(r.stopped).toEqual([])
+ vi.advanceTimersByTime(10000)
+ expect(r.stopped).toEqual(['meeting'])
+ expect(r.starts).toHaveLength(1)
+ await recordingFinished('meeting')
+ } finally { off(); vi.useRealTimers() }
+ })
+
it('pause targets only the active session, is idempotent, and survives a helper restart', async () => {
const r = rig()
r.begin('paused-session')
diff --git a/app/test/chunker.test.ts b/app/test/chunker.test.ts
index 768e4f31..cc1a70a1 100644
--- a/app/test/chunker.test.ts
+++ b/app/test/chunker.test.ts
@@ -30,6 +30,17 @@ describe('chunker', () => {
expect(secs(out[1])).toBeGreaterThanOrEqual(2)
})
+ it('cuts a short mic mute immediately while a remote sentence stays open', () => {
+ const out: Chunk[] = []
+ const c = chunker(x => out.push(x))
+ feed(c.push, 'me', tone(1)); feed(c.push, 'them', tone(1))
+ c.push('me', 1000, new Float32Array(0))
+ expect(c.isOpen('them')).toBe(true)
+ feed(c.push, 'me', tone(1), 1050); feed(c.push, 'them', tone(1), 1000)
+ c.flush()
+ expect(out.map(x => [x.track, x.startMs, secs(x)])).toEqual([['me', 0, 1], ['me', 1050, 1], ['them', 0, 2]])
+ })
+
it('drops leading silence and starts the chunk where the voice starts', () => {
const out = run(cat(quiet(2), tone(1.5)))
expect(out).toHaveLength(1)
diff --git a/app/test/liveWords.test.ts b/app/test/liveWords.test.ts
index 4905c415..044be043 100644
--- a/app/test/liveWords.test.ts
+++ b/app/test/liveWords.test.ts
@@ -79,3 +79,11 @@ describe('afterFinal', () => {
expect(afterFinal(ws, { endMs: 1000, text: '' })).toEqual([])
})
})
+
+it('a pre-mute final leaves the same word said again after unmute on screen', () => {
+ const before = { text: 'Testing', startMs: 100, endMs: 300, rough: true, muteMs: 350 }
+ const after = { text: 'Testing', startMs: 400, endMs: 600, rough: true }
+ const pending = replaceWords([before], [after], () => true)
+ expect(pending).toEqual([before, after])
+ expect(afterFinal(pending, { text: 'Testing, testing.', endMs: 350 })).toEqual([after])
+})
diff --git a/app/test/micToggle.test.ts b/app/test/micToggle.test.ts
new file mode 100644
index 00000000..798b9617
--- /dev/null
+++ b/app/test/micToggle.test.ts
@@ -0,0 +1,31 @@
+import { createElement } from 'react'
+import { renderToStaticMarkup } from 'react-dom/server'
+import { expect, it } from 'vitest'
+import { MicToggle } from '../src/renderer/src/components/MicToggle'
+import type { MicState } from '../src/shared/types'
+
+it('sets the native disabled attribute while paused, switching, or awaiting a confirmed mic state', () => {
+ const button = (state: MicState, paused = false) =>
+ renderToStaticMarkup(createElement(MicToggle, { id: 'meeting', state, paused }))
+ for (const state of ['on', 'off', 'still-off'] as const) {
+ expect(button(state)).not.toContain(' disabled=""')
+ expect(button(state, true)).toContain(' disabled=""')
+ }
+ for (const state of ['muting', 'unmuting', 'restoring-off', 'unconfirmed'] as const) {
+ expect(button(state)).toContain(' disabled=""')
+ }
+})
+
+it('keeps the last confirmed icon and pressed state on both buttons until the reply', () => {
+ for (const pill of [true, false]) {
+ const markup = (state: MicState) => renderToStaticMarkup(createElement(MicToggle, { id: 'meeting', state, pill }))
+ const icon = (state: MicState) => markup(state).match(/<svg.*?<[/]svg>/)?.[0]
+ for (const [settled, pending, pressed] of [['on', 'muting', false], ['off', 'unmuting', true], ['off', 'restoring-off', true]] as const) {
+ expect(icon(pending)).toBeTruthy()
+ expect(icon(pending)).toEqual(icon(settled))
+ expect(markup(pending)).toContain(`aria-pressed="${pressed}"`)
+ expect(markup(pending)).toContain('aria-busy="true"')
+ }
+ expect(icon('on')).not.toBe(icon('off'))
+ }
+})
diff --git a/app/test/transcription.test.ts b/app/test/transcription.test.ts
index 17d261b8..fba6bede 100644
--- a/app/test/transcription.test.ts
+++ b/app/test/transcription.test.ts
@@ -2,17 +2,18 @@ import { AUDIO_SPEAKER } from '../src/shared/audioUpload'
import { EventEmitter } from 'node:events'
import { PassThrough } from 'node:stream'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-import { Capture, encodeFrame, hookCapture, setRecordingPaused, recordingFinished, type CaptureProc } from '../src/main/capture'
-import { liveSilentMs, hookTranscription, transcribeRecorded, settleTranscription, speechLocaleFor, spokenChanged, stopTranscriptionServer, transcribing, releaseIdleSpeech } from '../src/main/asr'
+import { Capture, encodeFrame, hookCapture, setMicMuted, setRecordingPaused, recordingFinished, type CaptureProc } from '../src/main/capture'
+import { liveSilentMs, hookTranscription, transcribeRecorded, settleTranscription, transcriptPartials, speechLocaleFor, spokenChanged, stopTranscriptionServer, transcribing, releaseIdleSpeech } from '../src/main/asr'
import type { Spoken } from '../src/shared/spoken'
import type { TranscriptPartial } from '../src/shared/types'
import { openStore, type Meeting, type Store } from '../src/main/store'
import type { Line } from '../src/main/asr/transcribe'
+import { aec3 } from '../src/main/asr/aec3'
import type { Chunk } from '../src/main/asr/chunker'
// these tests are about the session around the pipeline; the echo canceller is tested on its own (aec.test.ts), and its
// work on minutes of test audio would only make them slow on CI
-vi.mock('../src/main/asr/aec3', () => ({ loadAec3: async () => {}, aec3: () => null }))
+vi.mock('../src/main/asr/aec3', () => ({ loadAec3: async () => {}, aec3: vi.fn(() => null) }))
const RATE = 16000
const tone = (sec: number) => Float32Array.from({ length: Math.round(sec * RATE) }, (_, i) => 0.3 * Math.sin(i / 10))
@@ -48,7 +49,7 @@ const disposers: Array<() => void> = []
afterEach(async () => { disposers.splice(0).forEach((d) => d()); await settleTranscription(2000); stopTranscriptionServer() })
/** both hooks over one shared start/stop fan-out, registered in the order asked for */
-function rig(order: 'capture-first' | 'transcription-first', t: { transcriber?: (c: Chunk, heard?: (language: string, chars: number) => void) => Promise<Line[]> | Line[]; modelPath?: () => string | undefined; refresh?: (id: string) => void; holdMs?: number; queued?: (id: string) => void } = {}) {
+function rig(order: 'capture-first' | 'transcription-first', t: { transcriber?: (c: Chunk, heard?: (language: string, chars: number) => void, opts?: { partial?: boolean }) => Promise<Line[]> | Line[]; sendPartial?: (p: TranscriptPartial) => void; modelPath?: () => string | undefined; refresh?: (id: string) => void; holdMs?: number; queued?: (id: string) => void } = {}) {
const starts: Array<(m: Meeting) => void> = [], stops: Array<(m: Meeting) => void> = []
const onStart = (fn: (m: Meeting) => void) => { starts.push(fn); return () => {} }
const onStop = (fn: (m: Meeting) => void) => { stops.push(fn); return () => {} }
@@ -56,7 +57,7 @@ function rig(order: 'capture-first' | 'transcription-first', t: { transcriber?:
const sent: string[] = [], warns: string[] = []
const hookT = () => disposers.push(hookTranscription({
store, modelPath: t.modelPath ?? (() => '/model.bin'), send: (s) => sent.push(`${s.track}:${s.text}`), warn: (c) => warns.push(c),
- refresh: t.refresh, holdMs: t.holdMs, queued: t.queued, transcriber: 'transcriber' in t ? t.transcriber : async (c) => says(c), onStart, onStop, pidFile: undefined,
+ sendPartial: t.sendPartial, refresh: t.refresh, holdMs: t.holdMs, queued: t.queued, transcriber: 'transcriber' in t ? t.transcriber : async (c) => says(c), onStart, onStop, pidFile: undefined,
}))
const hookC = () => hookCapture({
dirOf: (id) => `/m/${id}`, onStart, onStop, stopMeeting: (id) => stops.forEach((f) => f({ id } as Meeting)),
@@ -73,6 +74,95 @@ function rig(order: 'capture-first' | 'transcription-first', t: { transcriber?:
}
describe('live transcription of a meeting', () => {
+ it('keeps the visible mic words until a delayed final replaces them while muted', async () => {
+ const shown: string[] = []
+ let finish!: (lines: Line[]) => void
+ const r = rig('transcription-first', { holdMs: 0, sendPartial: part => {
+ if (part.track === 'me') shown.push(part.text || r.sent.at(-1) || '')
+ }, transcriber: (c, _hear, opts) => opts?.partial
+ ? [{ track: c.track, startMs: 150, endMs: 800, text: 'Testing testing' }]
+ : new Promise(resolve => { finish = resolve }) })
+ const m = meeting()
+ r.begin(m)
+ const out = r.procs[0].proc.stdout as PassThrough
+ try {
+ r.procs[0].say('me', 0)
+ await tick()
+ expect(shown).toEqual(['Testing testing'])
+ setMicMuted(m.id, true); out.write(encodeFrame({ t: 'mic-muted', id: 1, muted: true, ms: 2000 }))
+ expect(transcriptPartials().find(p => p.track === 'me')?.text).toBe('Testing testing')
+ finish([{ track: 'me', startMs: 80, endMs: 1000, text: 'Testing, testing.' }])
+ await expect.poll(() => shown).toEqual(['Testing testing', 'Testing testing', 'me:Testing, testing.'])
+ expect(r.sent).toEqual(['me:Testing, testing.'])
+ } finally { await r.stop(m) }
+ })
+
+ it('finishes the mic audio still buffered by echo cancellation while muted', async () => {
+ const shown: string[] = []
+ vi.mocked(aec3).mockReturnValue({ analyze() {}, process(input, output) { output.set(input) }, free() {} })
+ const clock = vi.spyOn(performance, 'now')
+ clock.mockReturnValue(0)
+ const r = rig('transcription-first', { holdMs: 0, sendPartial: p => {
+ if (p.track === 'me') shown.push(p.text || r.sent.at(-1) || '')
+ }, transcriber: (c, _hear, opts) => [{ track: c.track, startMs: opts?.partial ? 150 : 80, endMs: c.startMs + c.samples.length / 16,
+ text: opts?.partial ? 'Testing testing' : 'Testing, testing.' }] })
+ const m = meeting()
+ r.begin(m)
+ const out = r.procs[0].proc.stdout as PassThrough
+ try {
+ out.write(encodeFrame({ t: 'pcm', track: 'them', ms: 0, samples: new Float32Array(800 * 16) }))
+ out.write(encodeFrame({ t: 'pcm', track: 'me', ms: 0, samples: tone(0.9) }))
+ await tick()
+ expect(shown).toEqual(['Testing testing'])
+ setMicMuted(m.id, true); out.write(encodeFrame({ t: 'mic-muted', id: 1, muted: true, ms: 900 }))
+ out.write(encodeFrame({ t: 'pcm', track: 'me', ms: 900, samples: tone(1) }))
+ clock.mockReturnValue(3000)
+ out.write(encodeFrame({ t: 'level', me: 0, them: 0 }))
+ await expect.poll(() => shown).toEqual(['Testing testing', 'Testing testing', 'me:Testing, testing.'])
+ expect(store.segments(m.id)).toMatchObject([{ startMs: 80, endMs: 900 }])
+ } finally { clock.mockRestore(); vi.mocked(aec3).mockReturnValue(null); await r.stop(m) }
+ })
+
+ it('reads both sides of a brief mute separately on the original recording clock', async () => {
+ const clips: Array<[number, number]> = []
+ const r = rig('transcription-first', { transcriber: c => {
+ clips.push([c.startMs, c.samples.length / 16])
+ return says(c)
+ } })
+ const m = meeting()
+ r.begin(m)
+ const out = r.procs[0].proc.stdout as PassThrough
+ out.write(encodeFrame({ t: 'pcm', track: 'me', ms: 0, samples: tone(0.4) }))
+ setMicMuted(m.id, true); out.write(encodeFrame({ t: 'mic-muted', id: 1, muted: true, ms: 400 }))
+ setMicMuted(m.id, false); out.write(encodeFrame({ t: 'mic-muted', id: 2, muted: false, ms: 450 }))
+ out.write(encodeFrame({ t: 'pcm', track: 'me', ms: 450, samples: tone(0.4) }))
+ out.write(encodeFrame({ t: 'pcm', track: 'me', ms: 850, samples: new Float32Array(RATE * 1.2) }))
+ await r.stop(m)
+ expect(clips.map(([start]) => start)).toEqual([0, 450])
+ expect(clips[0][1]).toBe(400)
+ expect(clips[1][1]).toBeGreaterThanOrEqual(400)
+ })
+
+ it('finishes eligible pre-mute words but fences a delayed Whisper partial after unmute', async () => {
+ const parts: TranscriptPartial[] = []
+ let finishRead!: (lines: Line[]) => void
+ const r = rig('transcription-first', { sendPartial: p => parts.push(p), transcriber: (chunk, _hear, opts) =>
+ opts?.partial ? new Promise(resolve => { finishRead = resolve }) : says(chunk) })
+ const m = meeting()
+ r.begin(m)
+ const out = r.procs[0].proc.stdout as PassThrough
+ try {
+ out.write(encodeFrame({ t: 'pcm', track: 'me', ms: 0, samples: tone(0.9) }))
+ expect(finishRead).toBeTypeOf('function')
+ setMicMuted(m.id, true); out.write(encodeFrame({ t: 'mic-muted', id: 1, muted: true, ms: 900 }))
+ setMicMuted(m.id, false); out.write(encodeFrame({ t: 'mic-muted', id: 2, muted: false, ms: 950 }))
+ finishRead([{ track: 'me', startMs: 0, endMs: 800, text: 'Old partial' }])
+ await tick()
+ expect(parts.every(p => !p.text.includes('Old partial'))).toBe(true)
+ } finally { await r.stop(m) }
+ expect(r.sent).toEqual(['me:me said it at 0'])
+ })
+
it('only clears pending audio after transcription saves, and retains older unfinished sessions', async () => {
const r = rig('transcription-first'), m = meeting()
r.begin(m)
@@ -329,6 +419,25 @@ describe('the spoken language picked', () => {
return { m, procs, parts, speak, stop: async () => { stops.forEach((f) => f(m)); procs[0].exit(0); await recordingFinished(m.id); await settleTranscription(2000) } }
}
+ it('keeps the live mic partial and ignores delayed Apple words across a short mute', async () => {
+ const r = await speechRig(() => 'en')
+ const out = r.procs[0].proc.stdout as PassThrough
+ const say = (track: 'me' | 'them', startMs: number, text: string) =>
+ out.write(encodeFrame({ t: 'speech', track, final: false, startMs, endMs: startMs + 200, text }))
+ try {
+ say('me', 100, 'Before'); say('them', 200, 'Remote')
+ setMicMuted(r.m.id, true); out.write(encodeFrame({ t: 'mic-muted', id: 1, muted: true, ms: 350 }))
+ out.write(encodeFrame({ t: 'speech-ready', tracks: ['them'] }))
+ say('me', 100, 'Late mic reading'); say('them', 350, 'Remote continues')
+ expect(r.parts.filter(p => p.track === 'me').map(p => p.text)).toEqual(['Before', 'Before'])
+ setMicMuted(r.m.id, false); out.write(encodeFrame({ t: 'mic-muted', id: 2, muted: false, ms: 400 }))
+ out.write(encodeFrame({ t: 'speech-ready', tracks: ['me', 'them'] }))
+ say('me', 100, 'Old interval'); say('me', 450, 'After')
+ expect(r.parts.filter(p => p.track === 'me').at(-1)?.text).toBe('Before After')
+ expect(r.parts.filter(p => p.track === 'them').at(-1)?.text).toBe('Remote continues')
+ } finally { await r.stop() }
+ })
+
it("English only: Apple's speech listens in English, in the interface's region, whatever the last meeting was in", async () => {
const r = await speechRig(() => 'en')
expect(r.procs[0].locale).toBe('en-GB')
@@ -469,7 +578,7 @@ describe('live silence for call detection', () => {
const r = rig('transcription-first', { transcriber: () => [] }), m = meeting()
r.begin(m)
const output = r.procs[0].proc.stdout as PassThrough
- const frame = (voice?: 'me' | 'them', tracks = ['me', 'them'] as const) => {
+ const frame = (voice?: 'me' | 'them', tracks: readonly ('me' | 'them')[] = ['me', 'them']) => {
now += 100; ms += 100
for (const track of tracks) output.write(encodeFrame({ t: 'pcm', track, ms, samples: voice === track ? tone(0.1) : new Float32Array(1600) }))
}
@@ -497,6 +606,12 @@ describe('live silence for call detection', () => {
for (let i = 0; i < 31; i++) { now += 100; ms += 100; output.write(encodeFrame({ t: 'pcm', track: 'me', ms, samples: new Float32Array(1600) })) }
expect(liveSilentMs(m.id)).toBe(0)
frame(); expect(liveSilentMs(m.id)).toBe(0)
+ setMicMuted(m.id, true)
+ output.write(encodeFrame({ t: 'mic-muted', id: 1, muted: true, ms }))
+ expect(liveSilentMs(m.id)).toBe(0)
+ for (let i = 0; i < 610; i++) frame(undefined, ['them'])
+ expect(liveSilentMs(m.id)).toBeGreaterThanOrEqual(60_000)
+ frame('them', ['them']); expect(liveSilentMs(m.id)).toBe(0)
} finally { time.mockRestore(); await r.stop(m) }
expect(liveSilentMs(m.id)).toBe(0)
})
diff --git a/app/test/wave.test.ts b/app/test/wave.test.ts
index b287ba61..7a496f99 100644
--- a/app/test/wave.test.ts
+++ b/app/test/wave.test.ts
@@ -1,11 +1,22 @@
import { describe, expect, it } from 'vitest'
-import { micFloor, silentSpeech, speechAt, speechBars, speechRestAt, speechSample } from '../src/shared/speechWave'
+import { recordingSpeech, micFloor, silentSpeech, speechAt, speechBars, speechRestAt, speechSample } from '../src/shared/speechWave'
const input = (db: number) => ({ me: Math.max(0, (db + 60) / 60), them: 0 })
const on = speechSample(silentSpeech, input(-25), 0)
const atStrength = (phase: number, reduced = false) => speechBars({ drive: 1, phase }, reduced).heights
describe('recording speech wave', () => {
+ it('uses call audio only while muted, with a separate room and call noise floor', () => {
+ const floors = { me: Array(60).fill(-30), them: Array(60).fill(-50) }
+ const speaks = (me: number, them: number, muted: boolean) =>
+ recordingSpeech(silentSpeech, { me: input(me).me, them: input(them).me }, floors, muted, 100).speaking
+ expect(speaks(-25, -25, false)).toBe(false)
+ expect(speaks(-15, -60, false)).toBe(true)
+ expect(speaks(-15, -60, true)).toBe(false)
+ expect(speaks(-60, -42, true)).toBe(false)
+ expect(speaks(-60, -36, true)).toBe(true)
+ })
+
it('uses only the microphone and keeps small fluctuations inside the speech gate from moving it', () => {
expect(speechSample(silentSpeech, { me: 0, them: 1 }, 0).speaking).toBe(false)
expect(speechSample(silentSpeech, input(-47), 0).speaking).toBe(false)
diff --git a/app/test/widgetModel.test.ts b/app/test/widgetModel.test.ts
index 28498f52..69ba984f 100644
--- a/app/test/widgetModel.test.ts
+++ b/app/test/widgetModel.test.ts
@@ -57,6 +57,20 @@ describe('widget model', () => {
expect(w.view(22000)).toMatchObject({ kind: 'captured', elapsedMs: 10000 })
expect(w.view(22000)?.paused).toBeUndefined()
})
+ it('keeps the clock and call warning while muted and clears mute on a new recording', () => {
+ const w = new WidgetModel()
+ w.start(m); w.micState = 'off'; w.warn('no-mic')
+ expect(w.view(6000)).toMatchObject({ micState: 'off', elapsedMs: 5000, note: null })
+ w.warn('no-system-audio')
+ expect(w.view(7000)?.note).toMatchObject({ code: 'no-system-audio', text: 'Mic off. Yogurt can’t hear call audio.' })
+ w.pause(true, 7000)
+ expect(w.view(8500)).toMatchObject({ paused: true, micState: 'off', elapsedMs: 6000 })
+ w.micState = 'unconfirmed'; w.stop(9000)
+ expect(w.view(9500)?.note?.text).toBe('Mic mute couldn’t be confirmed.')
+ w.start(m)
+ expect(w.micState).toBe('on')
+ })
+
it('hints stay until the call is over; device changes say nothing', () => {
const w = new WidgetModel()
w.start(m)