这是indexloc提供的服务,不要输入任何密码
Skip to content

TTS Fallback adapter doesn't support streaming, if any one or more of the base TTS service doesn't supports it #2930

@ishanExtreme

Description

@ishanExtreme

Issue details:

TTS fallback adapter sets streaming capabilities to false if any of the TTS service doesn't supports it.
livekit/agents/tts/fallback_adapter.py

## line 83
super().__init__(
            capabilities=TTSCapabilities(
                streaming=all(t.capabilities.streaming for t in tts), ## --> Note here
                aligned_transcript=all(t.capabilities.aligned_transcript for t in tts),
            ),
            sample_rate=sample_rate,
            num_channels=num_channels,
        )

Required functionality:

Like in STT router when streaming is not supported VAD is applied automatically similarly StreamingAdapter must be applied to all non streaming TTS, thus making streaming supported services to work as intended
livekit/agents/stt/fallback_adapter.py

## line 55
non_streaming_stt = [t for t in stt if not t.capabilities.streaming]
        if non_streaming_stt:
            if vad is None:
                labels = ", ".join(t.label for t in non_streaming_stt)
                raise ValueError(
                    f"STTs do not support streaming: {labels}. "
                    "Provide a VAD to enable stt.StreamAdapter automatically "
                    "or wrap them with stt.StreamAdapter before using this adapter."
                )
            from ..stt import StreamAdapter

            stt = [
                StreamAdapter(stt=t, vad=vad) if not t.capabilities.streaming else t for t in stt
            ]

        super().__init__(
            capabilities=STTCapabilities(
                streaming=True,
                interim_results=all(t.capabilities.interim_results for t in stt),
            )
        )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions