/// <summary>
        /// WAVEファイルを生成する
        /// </summary>
        /// <param name="textToSpeak">
        /// Text to Speak</param>
        /// <param name="wave">
        /// WAVEファイルのパス</param>
        private void CreateWave(
            string textToSpeak,
            string wave)
        {
            var client = new VoiceTextClient()
            {
                APIKey       = Settings.Default.HOYASettings.APIKey,
                Speaker      = Settings.Default.HOYASettings.Speaker,
                Emotion      = Settings.Default.HOYASettings.Emotion,
                EmotionLevel = Settings.Default.HOYASettings.EmotionLevel,
                Volume       = Settings.Default.HOYASettings.Volume,
                Speed        = Settings.Default.HOYASettings.Speed,
                Pitch        = Settings.Default.HOYASettings.Pitch,
                Format       = Format.WAV,
            };

            ServicePointManager.SecurityProtocol =
                SecurityProtocolType.SystemDefault |
                SecurityProtocolType.Tls11 |
                SecurityProtocolType.Tls12;

            var waveData = client.GetVoice(textToSpeak);

            File.WriteAllBytes(wave, waveData);
        }
        /// <summary>
        /// WAVEファイルを生成する
        /// </summary>
        /// <param name="textToSpeak">
        /// Text to Speak</param>
        /// <param name="wave">
        /// WAVEファイルのパス</param>
        private void CreateWave(
            string textToSpeak,
            string wave)
        {
            var client = new VoiceTextClient()
            {
                APIKey       = TTSYukkuriConfig.Default.HOYASettings.APIKey,
                Speaker      = TTSYukkuriConfig.Default.HOYASettings.Speaker,
                Emotion      = TTSYukkuriConfig.Default.HOYASettings.Emotion,
                EmotionLevel = TTSYukkuriConfig.Default.HOYASettings.EmotionLevel,
                Volume       = TTSYukkuriConfig.Default.HOYASettings.Volume,
                Speed        = TTSYukkuriConfig.Default.HOYASettings.Speed,
                Pitch        = TTSYukkuriConfig.Default.HOYASettings.Pitch,
            };

            var waveData = client.GetVoice(textToSpeak);

            File.WriteAllBytes(wave, waveData);
        }
Beispiel #3
0
        /// <summary>
        /// WAVEファイルを生成する
        /// </summary>
        /// <param name="textToSpeak">
        /// Text to Speak</param>
        /// <param name="wave">
        /// WAVEファイルのパス</param>
        private void CreateWave(
            string textToSpeak,
            string wave)
        {
            var client = new VoiceTextClient()
            {
                APIKey       = Settings.Default.HOYASettings.APIKey,
                Speaker      = Settings.Default.HOYASettings.Speaker,
                Emotion      = Settings.Default.HOYASettings.Emotion,
                EmotionLevel = Settings.Default.HOYASettings.EmotionLevel,
                Volume       = Settings.Default.HOYASettings.Volume,
                Speed        = Settings.Default.HOYASettings.Speed,
                Pitch        = Settings.Default.HOYASettings.Pitch,
                Format       = Format.WAV,
            };

            // TLSプロトコルを設定する
            EnvironmentHelper.SetTLSProtocol();

            var waveData = client.GetVoice(textToSpeak);

            File.WriteAllBytes(wave, waveData);
        }