Constants used for properties of type LanguageCode.
Inheritance: ConstantClass
コード例 #1
0
            public static SynthesizeSpeechResponse SynthesizeSpeech(string textContent,
                                                                    Amazon.Polly.LanguageCode languageCode, string outputFormat = "mp3")
            {
                var synteshisRequest = new SynthesizeSpeechRequest
                {
                    Engine       = Engine.Neural,
                    OutputFormat = outputFormat,
                    //SampleRate = "8000",
                    Text         = textContent,
                    TextType     = "text",
                    VoiceId      = VoiceId.Joanna,
                    LanguageCode = languageCode
                };

                var client = new AmazonPollyClient(RegionEndpoint.USEast1);

                var task = client.SynthesizeSpeechAsync(synteshisRequest);

                task.Wait();

                return(task.Result);
            }