public void Synthesize(string content, VoiceConfig voiceConfig, bool ssml = false, double pitch = 1.0, double speakingRate = 1.0, double sampleRateHertz = Constants.DEFAULT_SAMPLE_RATE) { SynthesisInput synthesisInput = null; if (ssml) { synthesisInput = new SynthesisInputSSML() { ssml = content } } ; else { synthesisInput = new SynthesisInputText() { text = content } }; _textToSpeechManager.Synthesize(new PostSynthesizeRequest() { audioConfig = new AudioConfig() { audioEncoding = Constants.DEFAULT_AUDIO_ENCODING, pitch = pitch, sampleRateHertz = sampleRateHertz, speakingRate = speakingRate, volumeGainDb = Constants.DEFAULT_VOLUME_GAIN_DB }, input = synthesisInput, voice = new VoiceSelectionParams() { languageCode = voiceConfig.languageCode, name = voiceConfig.name, ssmlGender = voiceConfig.gender } }); }