Skip to content

Commit 0a1dad5

Browse files
authored
Add Murf AI - TTS Plugin Support (#3000)
1 parent 7050a93 commit 0a1dad5

File tree

12 files changed

+626
-1
lines changed

12 files changed

+626
-1
lines changed

livekit-agents/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ liveavatar = ["livekit-plugins-liveavatar>=1.4.5"]
9292
lmnt = ["livekit-plugins-lmnt>=1.4.5"]
9393
minimax = ["livekit-plugins-minimax-ai>=1.4.5"]
9494
mistralai = ["livekit-plugins-mistralai>=1.4.5"]
95+
murf = ["livekit-plugins-murf>=1.4.5"]
9596
neuphonic = ["livekit-plugins-neuphonic>=1.4.5"]
9697
nltk = ["livekit-plugins-nltk>=1.4.5"]
9798
nvidia = ["livekit-plugins-nvidia>=1.4.5"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Murf AI plugin for LiveKit Agents
2+
3+
Support for [Murf AI](https://murf.ai/)'s voice AI services in LiveKit Agents.
4+
5+
More information is available in the [API docs](https://murf.ai/api/docs).
6+
7+
## Installation
8+
9+
```bash
10+
pip install livekit-plugins-murf
11+
```
12+
13+
## Pre-requisites
14+
15+
You'll need an API key from Murf AI. It can be set as an environment variable: `MURF_API_KEY`
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2023 LiveKit, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Murf AI plugin for LiveKit Agents"""
16+
17+
from .tts import TTS, ChunkedStream
18+
from .version import __version__
19+
20+
__all__ = [
21+
"TTS",
22+
"ChunkedStream",
23+
"__version__",
24+
]
25+
26+
from livekit.agents import Plugin
27+
28+
from .log import logger
29+
30+
31+
class MurfPlugin(Plugin):
32+
def __init__(self) -> None:
33+
super().__init__(__name__, __version__, __package__, logger)
34+
35+
36+
Plugin.register_plugin(MurfPlugin())
37+
38+
# Cleanup docs of unexported modules
39+
_module = dir()
40+
NOT_IN_ALL = [m for m in _module if m not in __all__]
41+
42+
__pdoc__ = {}
43+
44+
for n in NOT_IN_ALL:
45+
__pdoc__[n] = False
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import logging
2+
3+
logger = logging.getLogger("livekit.plugins.murf")
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
from typing import Literal
2+
3+
TTSLocales = Literal[
4+
"en-US",
5+
"en-UK",
6+
"en-AU",
7+
"en-IN",
8+
"en-SCOTT",
9+
"es-ES",
10+
"es-MX",
11+
"hi-IN",
12+
"ta-IN",
13+
"bn-IN",
14+
"fr-FR",
15+
"de-DE",
16+
"it-IT",
17+
"pt-BR",
18+
"zh-CN",
19+
"nl-NL",
20+
"ja-JP",
21+
"id-ID",
22+
"ko-KR",
23+
"ro-RO",
24+
"tr-TR",
25+
"pl-PL",
26+
"sk-SK",
27+
"hr-HR",
28+
"el-GR",
29+
"bg-BG",
30+
]
31+
32+
TTSModels = Literal["GEN2", "FALCON"]
33+
34+
TTSStyles = Literal[
35+
"Promo",
36+
"Narration",
37+
"Calm",
38+
"Conversation",
39+
"Conversational",
40+
"Sad",
41+
"Angry",
42+
"Sports Commentary",
43+
"Newscast",
44+
"Terrified",
45+
"Inspirational",
46+
"Customer Support Agent",
47+
"Narration",
48+
"Audiobook",
49+
"Storytelling",
50+
"Furious",
51+
"Sobbing",
52+
"Wizard",
53+
"Clown",
54+
]
55+
56+
TTSEncoding = Literal[
57+
"pcm", # pcm_s16le
58+
]
59+
60+
TTSDefaultVoiceId = "en-US-matthew"
61+
TTSDefaultVoiceStyle = "Conversation"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)