public override void DrawOptions <TOptions>(TOptions serviceOptions) { this.serviceOptions = serviceOptions as SpeechLibTTSOptions; DrawExplanationLabel(); DrawVoicePopup(); GUILayout.Space(20); DrawRateField(); DrawVolumeField(); }
public override void Initialize(TextToSpeechOptions ttsOptions) { if (ttsOptions.GetType() == typeof(SpeechLibTTSOptions)) { windowsTTSOptions = (SpeechLibTTSOptions)ttsOptions; SpObjectTokenCategory tokenCat = new SpObjectTokenCategory(); tokenCat.SetId(SpeechLib.SpeechStringConstants.SpeechCategoryVoices, false); ISpeechObjectTokens tokens = tokenCat.EnumerateTokens(null, null); spVoice = new SpVoice(); spVoice.Voice = tokens.Item(windowsTTSOptions.Voice); spVoice.Volume = windowsTTSOptions.Volume; spVoice.Rate = windowsTTSOptions.Rate; spFileStream = new SpFileStream(); } }