@elevenlabs/client@1.19.0
Minor Changes
-
880edd2: Expose missing realtime speech-to-text options on
Scribe.connect(), matching elevenlabs-js#436:secondaryLanguages: additional language codes that may be present in the audio, sent as repeatedsecondary_languagesquery params.entityDetection: detect entities (PII, PHI, PCI, offensive language, or specific types) on committed transcripts. Accepts a single value or a list.filterBackgroundAudio: enable background speech filtering to reduce false activations from nearby conversations and ambient noise.
New server messages are now dispatched instead of being dropped:
final_transcriptandfinal_transcript_with_timestamps(RealtimeEvents.FINAL_TRANSCRIPT/FINAL_TRANSCRIPT_WITH_TIMESTAMPS)committed_transcript_entities, carryingDetectedEntity[](RealtimeEvents.COMMITTED_TRANSCRIPT_ENTITIES)invalid_request, sent when the server rejects the connection parameters (RealtimeEvents.INVALID_REQUEST), emitted alongside the genericERRORevent
Also fixes
vadSilenceThresholdSecs,minSpeechDurationMs, andminSilenceDurationMslower-bound validation to treat the bound as inclusive, matching the API (e.g.vadSilenceThresholdSecs: 0.3is now accepted instead of being rejected client-side).The
scribe.asyncapi.yamlschema (and the generatedWord/CommittedTranscriptWithTimestampsMessage/FinalTranscriptWithTimestampsMessagetypes) was cross-checked against the live contract athttps://api.elevenlabs.io/speech-to-text-asyncapi.yml. Thewords[]shape is identical betweencommitted_transcript_with_timestampsandfinal_transcript_with_timestampson that contract (both support"audio_event", per-character timings, andchannel_index), so both messages now share a singleWordtype instead of the narrower shapecommitted_transcript_with_timestampspreviously used.Configalso gainedtimestamps_granularityandmax_tokens_to_recomputeto match the session config the server echoes back.@elevenlabs/react'suseScribe().committedTranscripts[].words(WordTimestamp) is updated to match:typenow includes"audio_event",charactersis nowWordTimestampCharacter[](each with its ownstart/end) instead ofstring[], and achannel_indexfield was added.
Patch Changes
-
a068144: Fix a microphone-setup failure wedging
useScribe, so a denied or dismissed
permission prompt can be retried without remounting.A microphone-mode session whose
getUserMediacall rejects can never send
audio, but the socket was left open holding that session.useScribekept its
connection ref, and every laterconnect()short-circuited on"Already connected". The failed setup now closes the connection, which releases the
stranded socket and lets the hook's existing close handling clear the ref.
onErrorstill fires first; the session then ends asdisconnectedwith the
error preserved.The hook's close handler also nulled its ref for whichever connection reported
a close, so a late close from a replaced socket tore down the session that had
replaced it — the race a consumer hit when working around the above with
disconnect-then-reconnect. A close is now ignored when a newer connection owns
the ref, while an explicitdisconnect()still reports normally. -
Updated dependencies [880edd2]
- @elevenlabs/types@0.21.0