feat: refine meeting auto-start, silence timeout (25s) and improve transcription logging
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user