-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
api: texttospeechIssues related to the Text-to-Speech API.Issues related to the Text-to-Speech API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
Environment details
- OS type and version: macOS 10.14.3
- Java version: 1.8.152
- google-cloud-java version(s): google-cloud-texttospeech 0.80.0-beta
Steps to reproduce
- Run the below code sample. With a short messsage it doesn't happen.
Code example
public class GoogleTTSServiceImpl {
private TextToSpeechClient textToSpeechClient;
public GoogleTTSServiceImpl() throws IOException {
textToSpeechClient = TextToSpeechClient.create();
}
public void convert() throws Exception {
String message = "The war of words between Comcast and Netflix continued on Thursday, and it's getting personal.\n" +
"The companies, which have a partnership but also a very public ongoing feud, once again took to their respective blogs to argue over traffic, paid peering connections and the future of the Internet.\n" +
"Netflix claims that Comcast has unfairly required Netflix to pay for a so-called \"peering\" connection, in which companies directly connect respective networks, to alleviate a slowdown in its service. Comcast claims Netflix has purposefully set up its system to shift the costs of its data-intensive service on to customers and ISPs.\n" +
"The debate has become a closely watched proxy of a larger ongoing debate about Internet regulation, particularly whether peering should be a part of net neutrality.\n" +
"In a post entitled \"The Case Against ISP Trolls,\" Netflix called out Comcast by name.\n" +
"\"Put simply, there is one and only one way to reach Comcast’s subscribers at the last mile: Comcast,\" Ken Florance, vice president of content delivery at Netflix, wrote in a blog post.\n" +
"The blog post claims that Netflix is \"shouldering the costs and performing the transport function for which it used to pay transit providers,\"\n" +
"Comcast retorted, using its opening line to take a shot at Netflix.\n" +
"\"Netflix’s argument is a House of Cards,\" Jennifer Khoury, Comcast's senior vice president for corporate and digital communications, wrote in response.\n" +
"\"As we and other industry observers have already noted, Netflix’s decision to reroute its Internet traffic was all about improving Netflix’s business model,\" Comcast said in a blog post. \"While it’s understandable for Netflix to try to make all Internet users pay for its costs of doing business (as opposed to just their customers), the company should at least be honest about its cost-shifting strategy.\"\n" +
"The debate between the two has helped illuminate some of the wonky but important issues of the net neutrality debate that could end up having a long-term impact on Internet users.\n" +
"Net neutrality is back in the news as the FCC prepares new rules that could open the door for ISPs to negotiate with content providers for preferential treatment. That would mark an important departure from calls for regulation that wold require for all Internet traffic to be treated equally.\n" +
"The new rules do not touch on peering agreements of the type that Comcast and Netflix struck and continue to bicker about.\n" +
"Netflix CEO Reed Hastings said in a blog post published in March that the company had to enter into an agreement with Comcast to pay for a peering relationship because of inadequate net neutrality regulations.\n" +
"Internet watchdogs worry that as these agreements become common, startups will be unable to sign similar deals and be at a competitive disadvantage to larger, established companies.";
SynthesisInput input = SynthesisInput.newBuilder()
.setText(message)
.build();
VoiceSelectionParams voice = VoiceSelectionParams.newBuilder()
.setLanguageCode("en-US")
.build();
AudioConfig config = AudioConfig.newBuilder()
.setAudioEncoding(AudioEncoding.LINEAR16)
.build();
SynthesizeSpeechResponse response = textToSpeechClient.synthesizeSpeech(input, voice, config);
}
public static void main(String[] args) throws Exception {
GoogleTTSServiceImpl g = new GoogleTTSServiceImpl();
g.convert();
}
}Stack trace
com.google.api.gax.rpc.ResourceExhaustedException: io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: gRPC message exceeds maximum size 4194304: 7790801
at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:57)
at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)
at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)
at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)
at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1052)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:398)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1030)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:871)
at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:716)
at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:507)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:482)
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:694)
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:397)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459)
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:584)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Suppressed: com.google.api.gax.rpc.AsyncTaskException: Asynchronous task failed
at com.google.api.gax.rpc.ApiExceptions.callAndTranslateApiException(ApiExceptions.java:57)
at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
at com.google.cloud.texttospeech.v1.TextToSpeechClient.synthesizeSpeech(TextToSpeechClient.java:270)
at com.google.cloud.texttospeech.v1.TextToSpeechClient.synthesizeSpeech(TextToSpeechClient.java:243)
at com.raveu.ravebase.core.service.voice.tts.GoogleTTSServiceImpl.convert(GoogleTTSServiceImpl.java:41)
at com.raveu.ravebase.core.service.voice.tts.GoogleTTSServiceTest.readMeSomeText(GoogleTTSServiceTest.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: gRPC message exceeds maximum size 4194304: 7790801
at io.grpc.Status.asRuntimeException(Status.java:530)
... 23 more
Any additional information below
Works well when the message is short; but that message is 2821 characters; well under the 5000 listed in the documentation.
Metadata
Metadata
Assignees
Labels
api: texttospeechIssues related to the Text-to-Speech API.Issues related to the Text-to-Speech API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.