mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 02:47:34 +00:00
fix(speech): count any engine answer as progress while a dictation finishes
This commit is contained in:
@@ -47,16 +47,16 @@ export function waitForSttWorkerStop(args: {
|
||||
resolve()
|
||||
}
|
||||
const onStopped = (message: SttWorkerEvent): void => {
|
||||
if (message.streamId !== args.streamId) {
|
||||
return
|
||||
}
|
||||
if (message.type === 'stopped') {
|
||||
if (message.type === 'stopped' && message.streamId === args.streamId) {
|
||||
receivedStopped = true
|
||||
finish('stopped')
|
||||
return
|
||||
}
|
||||
// Text for this stream means the engine is still working through it, however long its backlog is.
|
||||
timeout?.refresh()
|
||||
// Sessions share one queue, so any answer means the engine is still working toward this stream, not hung.
|
||||
// A cancel keeps its short deadline.
|
||||
if (!args.discard) {
|
||||
timeout?.refresh()
|
||||
}
|
||||
}
|
||||
const onError = (error: Error): void => finish('error', error)
|
||||
const onExit = (): void => finish('exit')
|
||||
|
||||
@@ -6,7 +6,7 @@ const WAV_HEADER_BYTES = 44
|
||||
const CLOUD_RESPONSE_ALLOWANCE_MS = 30_000
|
||||
const UPLOAD_BYTES_PER_MS = 125
|
||||
|
||||
// A finishing on-device dictation fails once the engine goes this long without text for it.
|
||||
// A finishing on-device dictation fails once the engine goes this long without answering.
|
||||
export const LOCAL_DICTATION_STOP_TIMEOUT_MS = 60_000
|
||||
// How long an on-device model may take to load before its dictation fails.
|
||||
export const START_DICTATION_TIMEOUT_MS = 60_000
|
||||
|
||||
Reference in New Issue
Block a user