Merge pull request #3468 from pipecat-ai/mb/camb-cleanuo

Clean up CambTTSService
This commit is contained in:
Mark Backman
2026-01-15 17:16:28 -05:00
committed by GitHub
8 changed files with 10 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 20242025, Daily
# Copyright (c) 20242026, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2024-2025, Daily
# Copyright (c) 2024-2026, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2024-2025, Daily
# Copyright (c) 2024-2026, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#

View File

@@ -248,18 +248,10 @@ class CambTTSService(TTSService):
frame: The start frame containing initialization parameters.
"""
await super().start(frame)
# Use model-specific sample rate if not explicitly specified
if not self._init_sample_rate:
self._sample_rate = MODEL_SAMPLE_RATES.get(self._model_name, 22050)
self._settings["sample_rate"] = self._sample_rate
# Warn if sample rate doesn't match model's supported rate
if self._sample_rate != MODEL_SAMPLE_RATES.get(self._model_name):
logger.warning(
f"Camb.ai's {self._model_name} model requires "
f"{MODEL_SAMPLE_RATES.get(self._model_name)}Hz sample rate. "
f"Current rate of {self._sample_rate}Hz may cause issues."
)
self._sample_rate = MODEL_SAMPLE_RATES.get(self.model_name, 22050)
@traced_tts
async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2024-2025 Daily
# Copyright (c) 2024-2026, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2024-2025 Daily
# Copyright (c) 2024-2026, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2024-2025 Daily
# Copyright (c) 2024-2026, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#
@@ -9,7 +9,7 @@ import os
import sys
import tempfile
import unittest
from unittest.mock import AsyncMock, MagicMock, Mock, patch
from unittest.mock import MagicMock, patch
import numpy as np

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2024-2026 Daily
# Copyright (c) 2024-2026, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#