Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ function startRecording(meetingId: string, channels: AudioChannel[], withScreen
},
onStatus: (status) => emitLive({ type: 'status', channel, status }),
onError: (message) => {
// Mensajes de una sesión que ya se cerró (p. ej. al detener): no afectan a nada.
if (rec !== r) return
if (!isFatalLive(message)) return emitLive({ type: 'error', message })
const provider = LIVE_NAMES[liveProviderFor(settings)] ?? settings.liveProvider
emitLive({
Expand Down
5 changes: 4 additions & 1 deletion src/main/transcription/elevenlabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export function elevenLabsLive(o: LiveOptions, cb: LiveCallbacks): LiveSession {
case 'session_started':
case 'committed_transcript_entities':
case 'warning':
// Aviso de que no había audio pendiente al cerrar: no es un error.
case 'commit_throttled':
break
default:
if (msg.error || msg.message) cb.onError(`ElevenLabs (${msg.message_type}): ${msg.error ?? msg.message}`)
Expand Down Expand Up @@ -101,7 +103,8 @@ export function elevenLabsLive(o: LiveOptions, cb: LiveCallbacks): LiveSession {
},
stop() {
if (ws.readyState === WebSocket.OPEN) {
ws.send(chunk(new Uint8Array(0), true))
// ElevenLabs exige al menos 0,3 s sin confirmar para cerrar el último fragmento.
if (bytesSent / BYTES_PER_SECOND - lastCommit >= 0.3) ws.send(chunk(new Uint8Array(0), true))
setTimeout(() => ws.close(), 1500)
} else ws.terminate()
}
Expand Down
Loading