Clean up CambTTSService

This commit is contained in:
Mark Backman
2026-01-15 15:59:17 -05:00
parent c8e4b462c9
commit f3c2e29fb4
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 # 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 # 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 # SPDX-License-Identifier: BSD 2-Clause License
# #

View File

@@ -248,18 +248,10 @@ class CambTTSService(TTSService):
frame: The start frame containing initialization parameters. frame: The start frame containing initialization parameters.
""" """
await super().start(frame) await super().start(frame)
# Use model-specific sample rate if not explicitly specified # Use model-specific sample rate if not explicitly specified
if not self._init_sample_rate: if not self._init_sample_rate:
self._sample_rate = MODEL_SAMPLE_RATES.get(self._model_name, 22050) 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."
)
@traced_tts @traced_tts
async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]: 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 # 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 # 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 # SPDX-License-Identifier: BSD 2-Clause License
# #
@@ -9,7 +9,7 @@ import os
import sys import sys
import tempfile import tempfile
import unittest import unittest
from unittest.mock import AsyncMock, MagicMock, Mock, patch from unittest.mock import MagicMock, patch
import numpy as np 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 # SPDX-License-Identifier: BSD 2-Clause License
# #