feat: refine meeting auto-start, silence timeout (25s) and improve transcription logging

This commit is contained in:
michael.borak
2026-01-24 14:16:55 +01:00
parent a3e4fa4ec7
commit 9a65f42f51
5 changed files with 135 additions and 112 deletions

View File

@@ -123,15 +123,18 @@ const Recorder: React.FC<RecorderProps> = ({
const aggregateDev = aliasedDevs.find(d => d.name === 'Hearbit Audio');
const virtualDev = aliasedDevs.find(d => d.name.includes('Hearbit Virtual'));
if (aggregateDev) {
setRecordingMode('meeting');
setSelectedDevice(aggregateDev.id);
} else if (virtualDev) {
setRecordingMode('meeting');
setSelectedDevice(virtualDev.id);
} else {
setRecordingMode('voice');
if (aliasedDevs.length > 0) setSelectedDevice(aliasedDevs[0].id);
if (recordingMode === 'meeting') {
if (aggregateDev) {
setSelectedDevice(aggregateDev.id);
} else if (virtualDev) {
setSelectedDevice(virtualDev.id);
} else if (aliasedDevs.length > 0) {
setSelectedDevice(aliasedDevs[0].id);
}
} else if (aliasedDevs.length > 0) {
// Voice mode: just pick first non-virtual if possible, otherwise first
const physicalMic = aliasedDevs.find(d => !d.name.includes('Hearbit') && !d.name.includes('BlackHole'));
setSelectedDevice(physicalMic ? physicalMic.id : aliasedDevs[0].id);
}
}
} catch (e) {
@@ -160,7 +163,8 @@ const Recorder: React.FC<RecorderProps> = ({
deviceId: targetDeviceId,
savePath: savePath || null,
customFilename: props.recordingSubject || null,
waitForSpeech: autoStartEnabled // Pass the toggle state
waitForSpeech: autoStartEnabled, // Pass the toggle state
mode: recordingMode
});
setIsRecording(true);
@@ -268,7 +272,7 @@ const Recorder: React.FC<RecorderProps> = ({
// AUTO STOP Logic
// Use Ref to get LATEST visibility instantly
if (isVisibleRef.current && timeSinceSpeech > 20 && !isStoppingRef.current) {
if (isVisibleRef.current && timeSinceSpeech > 25 && !isStoppingRef.current) {
console.log("Auto-stopping due to silence...");
isStoppingRef.current = true;
addToast('Auto-stopped due to silence', 'info');