gpt4 book ai didi

java - 在企业网络中解锁防火墙以访问 Google 文本转语音 API 需要什么 URL?

转载 作者:行者123 更新时间:2023-12-02 04:32:28 24 4
gpt4 key购买 nike

当前的谷歌文本到语音我的java代码工作正常,但是当上传到服务器时,显示代码下方的错误,因为我知道服务器太安全,所以可能需要从防火墙解除阻止,但我找不到哪个正在后台访问。

我已尝试在环境变量中设置代理,但它不起作用。

try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
// Set the text input to be synthesized
SynthesisInput input = SynthesisInput.newBuilder()
.setText(strText)
.build();

VoiceSelectionParams voice = VoiceSelectionParams.newBuilder()
.setLanguageCode("en-US")
.setSsmlGender(SsmlVoiceGender.NEUTRAL)
.build();

// Select the type of audio file you want returned
AudioConfig audioConfig = AudioConfig.newBuilder()
.setAudioEncoding(AudioEncoding.MP3)
.build();

// Perform the text-to-speech request on the text input with the selected voice parameters and
// audio file type
SynthesizeSpeechResponse syntehsizeResponse = textToSpeechClient.synthesizeSpeech(input, voice,
audioConfig);

// Get the audio contents from the response
ByteString audioContents = syntehsizeResponse.getAudioContent();


Error-----------------------------------------------------------------

Caused by: javax.net.ssl.SSLHandshakeException: error:10000410:SSL routines:OPENSSL_internal:SSLV3_ALERT_HANDSHAKE_FAILURE
at io.grpc.netty.shaded.io.netty.handler.ssl.ReferenceCountedOpenSslEngine.shutdownWithError(ReferenceCountedOpenSslEngine.java:897)

最佳答案

speech.googleapis.com 是基本链接,需要在防火墙中清除。

关于java - 在企业网络中解锁防火墙以访问 Google 文本转语音 API 需要什么 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56574525/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com