async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:
        """Generate speech from text.

        Args:
            text: The text to convert to speech.

        Yields:
            Frames containing audio data and timing information.
        """
        logger.debug(f"{self}: Generating TTS [{text}]")
        try:
            if not self._websocket or self._websocket.closed:
                await self._connect()

            try:
                if not self._context_id:
                    await self.start_ttfb_metrics()
                    yield TTSStartedFrame()
                    self._cumulative_time = 0
                    self._context_id = str(uuid.uuid4())
                    await self.create_audio_context(self._context_id)

                msg = self._build_msg(text=text)
                await self._get_websocket().send(json.dumps(msg))
                await self.start_tts_usage_metrics(text)
            except Exception as e:
                logger.error(f"{self} error sending message: {e}")
                yield TTSStoppedFrame()
                await self._disconnect()
                await self._connect()
                return
            yield None
        except Exception as e:
            logger.error(f"{self} exception: {e}")
Generate speech from text.

        Args:
            text: The text to convert to speech.

        Yields:
            Frames containing audio data and timing information.
        
src/pipecat/services/rime/tts.py