简体   繁体   中英

C# Google Cloud Text-To-Speech Being - Wavenet Issue

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);
        }
    }

在此处输入图片说明

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”.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM