Skip to content

Version 0.8.0

Choose a tag to compare

@JayPanoz JayPanoz released this 27 Aug 15:24
· 216 commits to main since this release
287156d

What's Changed

Added

  • FallbackEngineProvider / FallbackSpeechEngine, wrapping a primary and a fallback ReadiumSpeechEngineProvider as 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 on ReadiumSpeechPlaybackEvent, emitted by FallbackSpeechEngine when it swaps engines in either direction.
  • ReadiumSpeechPlaybackEngine.loadUtterances() takes an optional startIndex hint, 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 optional forceRefresh parameter to bypass a provider's own voice cache — used by FallbackSpeechEngine'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 /synthesize chunk is declared stalled (SpeechServerStallError, 408) and aborted. Default undefined: 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 unrelated TypeError thrown later while reading a response that did arrive.
  • ErrorEventDetail, the { message, recoverable, ... } shape an engine's "error" event detail is expected to follow.
  • SpeechServerAudioDecodeError, thrown when a /synthesize response arrives and parses fine but its audio payload fails to decode.
  • recoverable on every SpeechServerEngine error event's detail: true when the server never responded at all (network failure or a stall), false when it responded but rejected the request or the audio payload failed to decode. Used by FallbackSpeechEngine to decide whether swapping engines could help.

Changed

  • SpeechServerEngine's "error" event detail always has at least { message, recoverable } now; { status, type, title, instance } is only present for a Problem Details response from the server.
  • SpeechServerEngine catches exceptions thrown by its own event listeners instead of letting one throw out of emitEvent() 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.

by @JayPanoz in #56

Full Changelog: v0.7.1...v0.8.0