feat(speechify): stream with timestamps via /v1/audio/stream/with-timestamps - #6926
Open
luke-speechify wants to merge 2 commits into
Open
feat(speechify): stream with timestamps via /v1/audio/stream/with-timestamps#6926luke-speechify wants to merge 2 commits into
luke-speechify wants to merge 2 commits into
Conversation
…estamps Use the streaming-native SSE endpoint (speechify-api >= 4.0.0) for SynthesizeStream, emitting audio chunks and aligned word marks as they become final. Legacy models (simba-english, simba-multilingual) fall back to one /v1/audio/speech request per sentence.
…odels Voices whose id carries a '_32' suffix (e.g. dominic_32) are part of the curated simba-3.2 roster. Log a warning when one is paired with any other model (including NOT_GIVEN, which the server resolves to simba-3.0).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SynthesizeStreamnow streams audio with word-level marks from the real streaming endpoint instead of issuing one batch request per sentence.For streaming-native models (
simba-3.0,simba-3.2, or no model given, which the server resolves tosimba-3.0) the stream uses/v1/audio/stream/with-timestampsvia the SDK'sstream_with_timestamps. Eachspeech.chunkevent pushes its PCM audio as it arrives and converts itsspeech_marksinto a timed transcript, so audio and aligned word timestamps are emitted while the audio is still landing.speech.doneends the sentence,speech.errorsurfaces asAPIStatusError.The legacy
simba-englishandsimba-multilingualmodels do not serve that route, the server rejects them with 400speech_marks_unsupported. They keep the per-sentence/v1/audio/speechpath unchanged.Changes
tts.py: route selection in_synthesize,_stream_request_kwargs(output_format=pcm_24000),_supports_streaming_marks, shared_marks_to_timed, rewired docstringpyproject.toml+uv.lock:speechify-apifloor>=3.0.1to>=4.0.0(first release withstream_with_timestamps)tts.py: warning when a curated simba-3.2 voice (id suffix_32, e.g.dominic_32) is paired with any other model, includingNOT_GIVENtests/test_plugin_speechify.py: new hermetic unit testsWhy it's not breaking
TTSmethod removed or altered in signaturesynthesize()path and the newstream()legacy branchUSERDATA_TIMED_TRANSCRIPTuserdataspeechify-apifloor bump only resolves forward; the methods the plugin uses exist in both versionsTest plan
mypystrict: clean on plugin and testsruffformat + lint: cleanpytest tests/test_plugin_speechify.py: 7 tests, covering the streaming route, legacy fallback,NOT_GIVENmodel, marks conversion, error propagation, and the voice/model warningsynthesize()multi-sentence offset accumulation correct