"""Text-to-speech (TTS) – single speaker."""
from google import genai
from google.genai import types
from _helpers import save_wav

def main() -> None:
    client = genai.Client()
    resp = client.models.generate_content(
        model="gemini-2.5-flash-preview-tts",
        contents="Say cheerfully: Have a wonderful day!",
        config=types.GenerateContentConfig(
            response_modalities=["AUDIO"],
            speech_config=types.SpeechConfig(
                voice_config=types.VoiceConfig(
                    prebuilt_voice_config=types.PrebuiltVoiceConfig(voice_name="Kore")
                )
            ),
        ),
    )

    pcm = resp.candidates[0].content.parts[0].inline_data.data
    save_wav("out.wav", pcm)
    print("Saved out.wav")

if __name__ == "__main__":
    main()
