When I submit synthesis requests for text that is too long, I get the following error:
google.api_core.exceptions.ResourceExhausted: 429 Received message larger than max (X vs. 4194304)
Where "X" is the size in bytes of the returned request. Why are requests limited to 4MB? I know that requests are limited to 5000 characters, but my requests are ~1500 characters, nowhere near the limit. Is it possible to receive messages larger than 4MB? Or is the 5000 character limit not the real bottleneck to Google text-to-speech?
If it changes anything, I'm using different en-us Wavenet voices with LINEAR16 encoding.
Here is a programmatic fix (Python) that worked for me (as proposed in this GitHub post: https://github.com/googleapis/python-texttospeech/issues/5#issuecomment-709562585)
from google.cloud import texttospeech_v1
from google.cloud.texttospeech_v1.services.text_to_speech.transports.grpc import (
TextToSpeechGrpcTransport,
)
channel = TextToSpeechGrpcTransport.create_channel(
options=[("grpc.max_receive_message_length", 24 * 1024 * 1024)]
)
transport = TextToSpeechGrpcTransport(channel=channel)
client = texttospeech_v1.TextToSpeechClient(transport=transport)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With