async def tts_to_input_audio_transformer(frame: Frame):
    """Transform TTS audio frames to InputAudioRawFrame with resampling.

    Converts 24kHz TTS output to 16kHz input audio required by the player LLM.

    Args:
        frame (Frame): The frame to transform (expected to be TTSAudioRawFrame)

    Returns:
        InputAudioRawFrame: The transformed and resampled input audio frame
    """
    if isinstance(frame, TTSAudioRawFrame):
        # Resample the audio from 24kHz to 16kHz
        resampled_audio = await resampler.resample(
            frame.audio,
            frame.sample_rate,  # Source rate (24kHz)
            16000,  # Target rate (16kHz)
        )

        # Create a new InputAudioRawFrame with the resampled audio
        input_frame = InputAudioRawFrame(
            audio=resampled_audio,
            sample_rate=16000,  # New sample rate
            num_channels=frame.num_channels,
        )
        return input_frame
Transform TTS audio frames to InputAudioRawFrame with resampling.

    Converts 24kHz TTS output to 16kHz input audio required by the player LLM.

    Args:
        frame (Frame): The frame to transform (expected to be TTSAudioRawFrame)

    Returns:
        InputAudioRawFrame: The transformed and resampled input audio frame
    
examples/word-wrangler-gemini-live/server/bot_phone_twilio.py