[英]C# Google Cloud Text-To-Speech Being - Wavenet Issue
亲爱的堆栈,
尽管我使用的代码没有使用“我认为”的wavenet,但我在谷歌云上因使用wavenet而被收费,如果我使用wavenet,有没有办法禁用它?
这是我的代码:
// [START tts_synthesize_text]
/// <summary>
/// Creates an audio file from the text input.
/// </summary>
/// <param name="text">Text to synthesize into audio</param>
/// <remarks>
/// Generates a file named 'output.mp3' in project folder.
/// </remarks>
public static void SynthesizeText(string text, string filename)
{
TextToSpeechClient client = TextToSpeechClient.Create();
var response = client.SynthesizeSpeech(new SynthesizeSpeechRequest
{
Input = new SynthesisInput
{
Text = text
},
// Note: voices can also be specified by name
Voice = new VoiceSelectionParams
{
LanguageCode = "en-US",
SsmlGender = SsmlVoiceGender.Female
},
AudioConfig = new AudioConfig
{
AudioEncoding = AudioEncoding.Mp3,
SpeakingRate = 0.75
}
});
using (Stream output = File.Create(filename))
{
response.AudioContent.WriteTo(output);
}
}
根据定价页面,您为 WaveNet 语音付费(减去 100 万个免费配额,0.2673*16 = 4.28)。 由于“ VoiceSelectionParams ”中的“name”参数为空,因此自动设置了 WaveNet 声音。 您需要指定“名称”参数,否则“服务将根据语言代码和性别等其他参数选择语音。” 您可以在此处的“音色名称”栏中找到音色名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.