forked from Blendman974/faceclaw
Fix a bunch of microphone-related bugs
> Most serious fixes > - Recordings kept forever: a recording made with captions off, or with "Save captions" > off, was transcoded to .m4a and kept indefinitely. No conversation linked to it, so > the phone UI never showed it and the retention settings never deleted it. Recording > now only happens alongside a saved caption session, and turning captions off ends > that session's recording properly. > - 4-mic mode went silent after a reconnect: a disconnect clears the phone's audio > forwarding, and nothing turned it back on, so the app kept showing "Listening (4-mic > array)" while hearing nothing. A check every 3 s now restores forwarding and re-sends > the config when it has been lost. The normal single-stream mode already recovered on > its own. > - Turning off "4-mic capture" mid-session went silent: it stopped the glasses' stream > but never switched to the normal stream. Setup changes now take effect live, > including switching between the two modes. > - Setup changes were undone: after the assistant closed, the app re-sent the config it > loaded at launch to the glasses, reverting any changes you'd made since. > - Startup failures: if the caption engine failed to start, the session got stuck > half-running. If the glasses weren't connected, listeners piled up and an empty > conversation could be left open. Startup now brings up the microphone first and > cleans up properly on failure. > > Other fixes > - Audio quality: the 4-mic beamformer put a small dropout at the start of every 25 ms > frame (an audible 40 Hz artifact in the audio feeding captions). Fixed, with a test > that fails on the old code. > - Stale direction data: an arm that stopped sending kept steering the direction > estimate and could hold the caption feed on a silent arm. > - Compass: closing Microphones switched off the Compass app's compass, because both > used the same owner name. > - Speaker database failures: > - A failed speaker reload wiped the in-memory list, so the next voice became a > duplicate "Speaker N". > - A failed speaker insert crashed caption handling; in re-diarize it reassigned > transcript lines to a nonexistent speaker. > - Translation: > - A crash path inside the model-download callback is now caught. > - Phones set to Hebrew, Indonesian or Yiddish never got translations, because of > old-style language codes. > - Ask questions: once the speaker list grew past the size limit (every unknown voice > adds a "Speaker N"), it pushed all transcript lines out of the context sent to the > model. When trimming is needed, the oldest lines now go first. > - Smaller fixes: > - The captions view stopped jumping back to live speech after 60 lines. > - "This is Dana calling…" was treated as introducing someone else. > - A model download that failed to start was stuck at "downloading" until restart. > - The developer mic monitor grew without limit while hidden.
This commit is contained in:
1 parent
22c31f4240
commit
b50898ea02
14 files changed
+409
-143
No files matched your search
@@ -139,8 +139,9 @@ export class SpeakerRegistry {
|
||||
}));
|
||||
this.loaded = true;
|
||||
} catch (error) {
|
||||
// Keep the last good cache: emptying it would make the next utterance
|
||||
// enroll an already-known voice as a duplicate "Speaker N".
|
||||
console.error(`speaker reload failed: ${String(error)}`);
|
||||
this.profiles = [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +195,8 @@ export class SpeakerRegistry {
|
||||
const id = Number(store().createSpeaker(name, color, false, encodeEmbedding(embedding)));
|
||||
this.reload();
|
||||
this.notifyChanged();
|
||||
const profile = this.byId(id)!;
|
||||
const profile = this.byId(id);
|
||||
if (!profile) throw new Error(`speaker "${name}" was not created (id ${id})`);
|
||||
return { profile, similarity: best?.similarity ?? 0, classification: "new", previousLastHeardAt: 0 };
|
||||
}
|
||||
|
||||
@@ -213,12 +215,14 @@ export class SpeakerRegistry {
|
||||
store().updateSpeakerEmbedding(existing.id, encodeEmbedding(embedding), CENTROID_UPDATE_CAP);
|
||||
this.reload();
|
||||
this.notifyChanged();
|
||||
return this.byId(existing.id)!;
|
||||
return this.byId(existing.id) ?? existing;
|
||||
}
|
||||
const id = Number(store().createSpeaker("Me", "#64B5F6", true, encodeEmbedding(embedding)));
|
||||
this.reload();
|
||||
this.notifyChanged();
|
||||
return this.byId(id)!;
|
||||
const profile = this.byId(id);
|
||||
if (!profile) throw new Error(`wearer profile was not created (id ${id})`);
|
||||
return profile;
|
||||
}
|
||||
|
||||
/** Is this utterance the wearer's own voice? Used to gate command recognition. */
|
||||
|
||||
Reference in new issue
Block a user