Repository navigation
Version 0.8.0
What's Changed
Added
FallbackEngineProvider/FallbackSpeechEngine, wrapping a primary and a fallbackReadiumSpeechEngineProvideras one.onFailure(default"fallback") controls the behavior:"fallback"swaps to the fallback on a recoverable playback failure (mid-playback included) and stays there;"fallbackAndRecover"additionally polls the primary and swaps back once it's reachable again;"error"never swaps, surfacing failures as-is. No registry involved."enginefallback"/"enginerecovered"events onReadiumSpeechPlaybackEvent, emitted byFallbackSpeechEnginewhen it swaps engines in either direction.ReadiumSpeechPlaybackEngine.loadUtterances()takes an optionalstartIndexhint, so an engine that pre-buffers ahead of playback (e.g.SpeechServerEngine) warms the utterances playback will actually resume at instead of always index 0.ReadiumSpeechEngineProvider.getVoices()takes an optionalforceRefreshparameter to bypass a provider's own voice cache — used byFallbackSpeechEngine's health check so a stale cache can't report the primary reachable when it isn't.SpeechServerEngineOptions.timeoutMs, a grace period tolerated after the playback buffer is projected to run dry before a still-pending/synthesizechunk is declared stalled (SpeechServerStallError, 408) and aborted. Defaultundefined: a stalled request waits forever, same as before this option existed.SpeechServerNetworkError, thrown when a request to the server never reaches the network at all — distinguishes an actual connectivity failure from an unrelatedTypeErrorthrown later while reading a response that did arrive.ErrorEventDetail, the{ message, recoverable, ... }shape an engine's"error"eventdetailis expected to follow.SpeechServerAudioDecodeError, thrown when a/synthesizeresponse arrives and parses fine but its audio payload fails to decode.recoverableon everySpeechServerEngineerror event'sdetail:truewhen the server never responded at all (network failure or a stall),falsewhen it responded but rejected the request or the audio payload failed to decode. Used byFallbackSpeechEngineto decide whether swapping engines could help.
Changed
SpeechServerEngine's"error"eventdetailalways has at least{ message, recoverable }now;{ status, type, title, instance }is only present for a Problem Details response from the server.SpeechServerEnginecatches exceptions thrown by its own event listeners instead of letting one throw out ofemitEvent()and abort the others.
Fixed
WebSpeechEngine.loadUtterances()called back-to-back while already"ready"now emits"ready"each time — it previously went through the same diff-based state setter as everything else, which swallowed a same-state transition.
Full Changelog: v0.7.1...v0.8.0