speech_core 0.2.0
speech_core: ^0.2.0 copied to clipboard
Provider-neutral speech recognition, synthesis, and analysis contracts.
Changelog #
0.2.0 #
- Add
SpeakerEmbedding, a speaker vector carrying the(providerId, modelId, dimension)space that produced it, plusspeakerSimilarity(null across spaces),requireSpeakerSimilarity(throwsSpeechEmbeddingSpaceMismatch) andl2NormalizeVector. Comparing embeddings from two different models can no longer return a plausible number, which is what turns a silent mislabel into a detectable one. This is the provider-output contract and where this package stops: saved voiceprints, centroid blending, and nearest-profile search are cross-meeting identity policy and belong to the intelligence layer. - Add
SpeakerSegment.embedding, an optional field. Providers that only forward speaker labels leave it null; existing call sites are unaffected. - Add
SpeechCapability.speakerEmbeddingandSpeechCapability.inverseTextNormalization, appended at the end of the enum. Persist capability sets byname, neverindex. - Add the
InverseTextNormalizerandCustomizableInverseTextNormalizerprovider contracts plusInverseTextNormalizationRule, so spoken-to-written conversion has a provider-neutral seat instead of being reached through a direct adapter import. - Add
BatchRecognitionSegment.words, an optionalList<SpeechWord>that defaults to empty and is copied on construction. Batch recognition could previously only return a block of untimed text, so nothing downstream could cut it into sentences, align it to a diarization span, or seek back into the audio — an asymmetry with the streaming path, which has always carriedSpeechTranscript.words. Existing call sites are unaffected. - Add
SpeechAudioGuardswithminimumRecognitionDuration(one second, the 16,000 samples at 16 kHz that batch recognizers need) and thespeech_audio_too_shortfailure code. Providers refuse shorter audio with a typedSpeechFailureinstead of returning an empty transcript, which is indistinguishable from the user having said nothing. - Add the turn-completion seam:
TurnCompletionScorerwithscoreTurnCompletion(TurnCompletionRequest), plusTurnCompletionScore(probability,isComplete, optionalthreshold) andTurnCompletionAudio(16 kHz, an eight-second maximum window, a 0.5 default threshold compared strictly greater-than). The request carries a finite monoBufferedAudioSource— narrower than theAudioSourcethe other batch requests accept, because a scorer that cannot see the end of the window has nothing to score — plus an optional threshold override, cancellation, and provider options. This is what lets a turn detector reach a prosody model in an adapter package without the two packages depending on each other. - Add
SpeechCapability.turnCompletion, appended at the end of the enum. Breaking for exhaustive switches: code that switches overSpeechCapabilitywithout a default arm stops compiling until the new member is handled. Persist capability sets byname, neverindex. - Add
TranscriptInverseTextNormalizer, an optional refinement ofInverseTextNormalizeraddingnormalizeTranscript(SpeechTranscript), plus thenormalizeTranscriptPreservingWordshelper implementing the baseline behavior over any string normalizer. ITN and word timings could not coexist: normalizing a transcript meant reducing it to a string and throwing away the timings that sentence segmentation, diarization alignment, and seeking all depend on. Deliberately a sub-interface rather than a new member onInverseTextNormalizer, so existing implementers keep compiling and a provider that can only rewrite strings stays a valid one; callers test for the stronger contract withis.
0.1.0 #
- Initial public release.