【发布时间】:2019-02-18 16:59:28
【问题描述】:
我正在创建一个涉及 Google Text-To-Speech 服务的实时语音应用程序。但是,我的延迟在 600-1100 毫秒之间,这对于我的应用程序来说太慢了。音频只有大约 3 秒长,我该如何改善呢? (延迟是衡量我发送请求然后接收音频所需的时间)。
更新
我使用的代码是:
//I call this at the start of my program
TTSclient = TextToSpeechClient.Create();
//This is the method that I call everytime I make a TTS call in my program
public static Google.Protobuf.ByteString MakeTTS(string text)
{
SynthesisInput input = new SynthesisInput
{
Text = text
};
VoiceSelectionParams voice = new VoiceSelectionParams
{
LanguageCode = "en-AU",
Name = "en-AU-Wavenet-A"
};
AudioConfig config = new AudioConfig
{
AudioEncoding = AudioEncoding.Linear16,
SampleRateHertz = 16000,
SpeakingRate = 0.9
};
var TTSresponse = TTSclient.SynthesizeSpeech(new SynthesizeSpeechRequest
{
Input = input,
Voice = voice,
AudioConfig = config
});
return TTSresponse.AudioContent;
}
谢谢
【问题讨论】:
标签: c# google-cloud-platform latency voice google-text-to-speech