Skip to content

Commit 56da2ca

Browse files
committed
Update Camb.ai TTS inference options
1 parent a541d65 commit 56da2ca

3 files changed

Lines changed: 3 additions & 15 deletions

File tree

examples/foundational/07zb-interruptible-camb-local.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ async def main(voice_id: int):
7474
aiohttp_session=session,
7575
voice_id=voice_id,
7676
model="mars-flash",
77-
params=CambTTSService.InputParams(
78-
speed=1.0,
79-
),
8077
)
8178

8279
# OpenAI LLM

src/pipecat/services/camb/tts.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- 140+ languages supported
1515
- Real-time HTTP streaming
1616
- 24kHz audio output
17-
- Voice customization (speed, instructions)
17+
- Voice customization (instructions for mars-instruct)
1818
"""
1919

2020
import asyncio
@@ -129,8 +129,7 @@ class CambTTSService(TTSService):
129129
"""Camb.ai MARS HTTP-based text-to-speech service.
130130
131131
Converts text to speech using Camb.ai's MARS TTS models with support for
132-
multiple languages. Provides control over voice characteristics like speed
133-
and custom instructions (for mars-instruct model).
132+
multiple languages. Provides custom instructions support for the mars-instruct model.
134133
135134
Example::
136135
@@ -140,8 +139,7 @@ class CambTTSService(TTSService):
140139
model="mars-flash",
141140
aiohttp_session=session,
142141
params=CambTTSService.InputParams(
143-
language=Language.EN,
144-
speed=1.0
142+
language=Language.EN
145143
)
146144
)
147145
@@ -163,13 +161,11 @@ class InputParams(BaseModel):
163161
164162
Parameters:
165163
language: Language for synthesis (BCP-47 format). Defaults to English.
166-
speed: Speech speed multiplier (0.5 to 2.0). Defaults to 1.0.
167164
user_instructions: Custom instructions for mars-instruct model only.
168165
Ignored for other models. Max 1000 characters.
169166
"""
170167

171168
language: Optional[Language] = Language.EN
172-
speed: Optional[float] = Field(default=1.0, ge=0.5, le=2.0)
173169
user_instructions: Optional[str] = Field(
174170
default=None,
175171
max_length=1000,
@@ -223,7 +219,6 @@ def __init__(
223219
if params.language
224220
else DEFAULT_LANGUAGE
225221
),
226-
"speed": params.speed or 1.0,
227222
"user_instructions": params.user_instructions,
228223
}
229224

@@ -312,7 +307,6 @@ async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:
312307
"language": self._settings["language"],
313308
"speech_model": self._model_name,
314309
"output_configuration": {"format": "pcm_s16le"},
315-
"voice_settings": {"speed": self._settings["speed"]},
316310
}
317311

318312
# Add user instructions if using mars-instruct model

tests/test_camb_tts.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,14 @@ async def test_input_params():
336336
# Test defaults
337337
params = CambTTSService.InputParams()
338338
assert params.language == Language.EN
339-
assert params.speed == 1.0
340339
assert params.user_instructions is None
341340

342341
# Test custom values
343342
params = CambTTSService.InputParams(
344343
language=Language.ES,
345-
speed=1.5,
346344
user_instructions="Speak slowly and clearly",
347345
)
348346
assert params.language == Language.ES
349-
assert params.speed == 1.5
350347
assert params.user_instructions == "Speak slowly and clearly"
351348

352349

0 commit comments

Comments
 (0)