Skip to content
Open
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
1 change: 1 addition & 0 deletions livekit-agents/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ neuphonic = ["livekit-plugins-neuphonic>=1.4.1"]
nltk = ["livekit-plugins-nltk>=1.4.1"]
nvidia = ["livekit-plugins-nvidia>=1.4.1"]
openai = ["livekit-plugins-openai>=1.4.1"]
pocket = ["livekit-plugins-pocket>=1.4.1"]
resemble = ["livekit-plugins-resemble>=1.4.1"]
rime = ["livekit-plugins-rime>=1.4.1"]
rtzr = ["livekit-plugins-rtzr>=1.4.1"]
Expand Down
25 changes: 25 additions & 0 deletions livekit-plugins/livekit-plugins-pocket/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Pocket TTS plugin for LiveKit Agents

Support for local voice synthesis with [Pocket TTS](https://github.com/kyutai-labs/pocket-tts).

## Installation

```bash
pip install livekit-plugins-pocket
```

## Usage

```python
from livekit.agents import AgentSession
from livekit.plugins import pocket

session = AgentSession(
tts=pocket.TTS(voice="alba"),
)
```

## Notes

- Pocket TTS output is emitted as mono PCM at native `24000` Hz.
- If `sample_rate` is passed with a different value, the plugin keeps `24000` Hz.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2024 LiveKit, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

"""Pocket TTS plugin for LiveKit Agents."""

from .tts import DEFAULT_VOICE, TTS, PocketTTS
from .version import __version__

__all__ = ["TTS", "PocketTTS", "DEFAULT_VOICE", "__version__"]

from livekit.agents import Plugin

from .log import logger


class PocketPlugin(Plugin):
def __init__(self) -> None:
super().__init__(__name__, __version__, __package__, logger)


Plugin.register_plugin(PocketPlugin())

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

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 LiveKit, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

import logging

logger = logging.getLogger("livekit.plugins.pocket")
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading