Reputation: 1784
Dear Stack,
I'm being charged on google cloud for using wavenet, despite the fact that the code im using is not using wavenet "i think", if I'm using wavenet, is there a way to disable it?
Here is my code:
// [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);
}
}
Upvotes: 0
Views: 329
Reputation: 742
According to pricing page you was charged for WaveNet voice (minus free quota 1 million, 0.2673*16 = 4.28). WaveNet sound was set automatically since the “name” parameter in “VoiceSelectionParams” was empty. You need to specify a “name” parameter otherwise “the service will choose a voice based on the other parameters such as language_code and gender.” Voice names you can find here in column “Voice name”.
Upvotes: 2