Ejemplo n.º 1
0
        public SpeechLibStrategy(Options options, int speedRate, ConvertorFactory.SupportedType supportedType)
        {
            _options = options;
            _supportedType = supportedType;

            Voice = new SpVoice
                {
                    Rate = speedRate,
                };

            SetVoice(Properties.Settings.Default.VoiceName);
        }
Ejemplo n.º 2
0
        private void Convert(string filename, Options options, ConvertorFactory.SupportedType supportedType)
        {
            var strategy = new SpeechLibStrategy(options, 4, supportedType);
            var voices = strategy.GetVoiceNames().ToList();
            Assert.IsTrue(voices.Count() == 2, "voices: " + string.Join(", ", voices));

            var model = new TextToVoiceModel
            {
                CurrentState = TextToVoiceModel.States.Run,
                OutFilePath = filename,
                FilePath = filename
            };

            model.SetText(testText);
            strategy.Execute(model, voices.Last());
        }