I am attempting to use the gemini-2.5-pro-tts model, voice: Puck with the Long Audio Synthesis API for generating long-form audio.
I am following the official documentation for creating long-form audio:
https://docs.cloud.google.com/text-to-speech/docs/create-audio-text-long-audio-synthesis
Given code snippet works correctly. But, when passing gemini-2.5-pro-tts as model_name, and Puck as name, it is giving error: This voice requires a model name to be specified.
Code causing the error:
voice = texttospeech.VoiceSelectionParams(
language_code="en-US",
name="Puck",
model_name="gemini-2.5-pro-tts" # This line seems to cause the Long Audio API to fail
)
client.synthesize_long_audio(request=request)
# full code: https://docs.cloud.google.com/text-to-speech/docs/create-audio-text-long-audio-synthesis#create_audio_data
Observed Error:
InvalidArgument: 400 This voice requires a model name to be specified.