Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TtsEspHelper"/> class.
 /// </summary>
 /// <param name="serviceProvider">ServiceProvider.</param>
 /// <param name="language">Language.</param>
 /// <param name="mode">Process mode.</param>
 public TtsEspHelper(SP.ServiceProvider serviceProvider, Language language, ProcessMode mode)
 {
     Helper.ThrowIfNull(serviceProvider);
     _serviceProvider = serviceProvider;
     _engine = serviceProvider.Engine;
     _language = language;
     _mode = mode;
 }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TtsEspHelper"/> class.
        /// </summary>
        /// <param name="language">Language.</param>
        /// <param name="voicePath">Voice font path.</param>
        /// <param name="langDllPath">Language dll path.</param>
        /// <param name="langDataPath">Language data path.</param>
        /// <param name="mode">Process mode.</param>
        public TtsEspHelper(Language language, string voicePath, string langDllPath,
            string langDataPath, ProcessMode mode)
        {
            if (string.IsNullOrEmpty(voicePath))
            {
                voicePath = null;
            }

            if (string.IsNullOrEmpty(langDllPath))
            {
                langDllPath = null;
            }

            if (string.IsNullOrEmpty(langDataPath))
            {
                langDataPath = null;
            }

            _language = language;
            if (string.IsNullOrEmpty(langDllPath) && string.IsNullOrEmpty(langDataPath))
            {
                _engine = new SP.TtsEngine((SP.Language)language, voicePath);
            }
            else if (string.IsNullOrEmpty(langDataPath))
            {
                _engine = new SP.TtsEngine((SP.Language)language, voicePath, langDllPath);
            }
            else
            {
                _engine = new SP.TtsEngine((SP.Language)language, voicePath, langDllPath, langDataPath);
            }

            _mode = mode;
        }