I’m working with the Gemini 2.5 Flash/Pro Preview TTS model.
I followed the snippet from the documentation here:
It works perfectly on my local machine (MacBook Pro) when running through my API wrapper.
However, when I deploy it to my development server using Docker (into k8s service), the generated WAV file turns into pure noise (broken audio). I’m still using the same guide-provided function to write PCM data into a WAV file:
def wave_file(filename, pcm, channels=1, rate=24000, sample_width=2):
with wave.open(filename, "wb") as wf:
wf.setnchannels(channels)
wf.setsampwidth(sample_width)
wf.setframerate(rate)
wf.writeframes(pcm)
Has anyone encountered this issue in a containerized environment, or knows what might cause the WAV output to break?