Module videosdk.plugins.cometapi.tts

Classes

class CometAPITTS (*,
api_key: str | None = None,
model: str = 'tts-1',
voice: str = 'alloy',
speed: float = 1.0,
response_format: str = 'pcm')
Expand source code
class CometAPITTS(OpenAITTS):
    def __init__(
        self,
        *,
        api_key: str | None = None,
        model: str = "tts-1",
        voice: str = "alloy",
        speed: float = 1.0,
        response_format: str = "pcm",
    ) -> None:
        """Initialize the CometAPI TTS plugin.

        Args:
            api_key (Optional[str], optional): CometAPI API key. Defaults to None.
            model (str): The model to use for the TTS plugin. Defaults to "tts-1".
            voice (str): The voice to use for the TTS plugin. Defaults to "alloy".
            speed (float): The speed to use for the TTS plugin. Defaults to 1.0.
            response_format (str): The response format to use for the TTS plugin. Defaults to "pcm".
        """
        super().__init__(
            api_key=api_key or os.getenv("COMETAPI_API_KEY"),
            model=model,
            voice=voice,
            speed=speed,
            base_url="https://api.cometapi.com/v1/",
            response_format=response_format,
        )

Base class for Text-to-Speech implementations

Initialize the CometAPI TTS plugin.

Args

api_key : Optional[str], optional
CometAPI API key. Defaults to None.
model : str
The model to use for the TTS plugin. Defaults to "tts-1".
voice : str
The voice to use for the TTS plugin. Defaults to "alloy".
speed : float
The speed to use for the TTS plugin. Defaults to 1.0.
response_format : str
The response format to use for the TTS plugin. Defaults to "pcm".

Ancestors

  • videosdk.plugins.openai.tts.OpenAITTS
  • videosdk.agents.tts.tts.TTS
  • videosdk.agents.event_emitter.EventEmitter
  • typing.Generic