Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,28 @@

"""Speechify plugin for LiveKit Agents

See https://docs.livekit.io/agents/integrations/tts/speechify/ for more information.
Provides Speechify text-to-speech for LiveKit voice agents. See
https://docs.speechify.ai for API details.
"""

from .models import TTSEncoding, TTSModels
from .tts import DEFAULT_VOICE_ID, TTS, Voice
from livekit.agents import Plugin

from .log import logger
from .models import TTSModels
from .tts import DEFAULT_MODEL, DEFAULT_VOICE_ID, TTS, ChunkedStream, GetVoice, SynthesizeStream
from .version import __version__

__all__ = [
"TTS",
"Voice",
"TTSEncoding",
"ChunkedStream",
"SynthesizeStream",
"GetVoice",
"TTSModels",
"DEFAULT_VOICE_ID",
"DEFAULT_MODEL",
"__version__",
]
Comment on lines +24 to 37

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Breaking public API: Voice class and TTSEncoding removed from exports

The old __init__.py exported Voice and TTSEncoding in __all__. The new version removes both and replaces them with ChunkedStream and SynthesizeStream. Any downstream code doing from livekit.plugins.speechify import Voice or from livekit.plugins.speechify import TTSEncoding will break at import time. The Voice dataclass (which held voice metadata like id, display_name, gender, models, locale) and the list_voices() method on TTS are also removed entirely, so there's no migration path for users who relied on voice enumeration. This may be intentional given the SDK migration, but should be documented in release notes.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored list_voices() on the TTS class (now backed by the official SDK's voices.list()), and re-exported GetVoice from the package, so voice enumeration has a migration path. The old TTSEncoding is intentionally dropped — synthesis is now fixed to 24 kHz PCM (the SDK's stream accept-set no longer exposes container/rate selection); noted for release notes.


from livekit.agents import Plugin

from .log import logger


class SpeechifyPlugin(Plugin):
def __init__(self) -> None:
Expand All @@ -42,7 +44,6 @@ def __init__(self) -> None:

Plugin.register_plugin(SpeechifyPlugin())

# Cleanup docs of unexported modules
_module = dir()
NOT_IN_ALL = [m for m in _module if m not in __all__]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 LiveKit, Inc.
# Copyright 2023 LiveKit, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -11,18 +11,14 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Literal

TTSModels = Literal[
"simba-english",
"simba-multilingual",
]

TTSEncoding = Literal[
"mp3_24000",
"wav_48000",
"ogg_24000",
"aac_24000",
"simba-3.0",
"simba-3.2",
]

VoiceType = Literal["shared", "personal"]
Expand Down
Loading
Loading