コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the ScriptSynthesizer class.
        /// </summary>
        /// <param name="serviceProvider">Service provider.</param>
        /// <param name="commonConfig">Common config of script synthesizer.</param>
        /// <param name="scriptFeatureImportConfig">Config of script feature import.</param>
        /// <param name="customizedFeaturePluginManager">Plugin manager of customized feature extraction.</param>
        public ScriptSynthesizer(ServiceProvider serviceProvider,
            ScriptSynthesizerCommonConfig commonConfig,
            ScriptFeatureImportConfig scriptFeatureImportConfig,
            CustomizedFeaturePluginManager customizedFeaturePluginManager)
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException("serviceProvider");
            }

            // commonConfig can be null.
            // scriptFeatureImportConfig can be null.
            // customizedFeaturePluginManager can be null.
            _serviceProvider = serviceProvider;

            _scriptFeatureImportConfig = scriptFeatureImportConfig;

            if (commonConfig != null)
            {
                _logger = new TextLogger(commonConfig.TraceLogFile);
                _logger.Reset();
            }

            if (_scriptFeatureImportConfig != null)
            {
                _scriptFeatureImport = new ScriptFeatureImport(commonConfig,
                    _scriptFeatureImportConfig, _serviceProvider, _logger);
            }

            if (customizedFeaturePluginManager != null)
            {
                _customizedFeatureExtraction = new CustomizedFeatureExtraction(_serviceProvider,
                    customizedFeaturePluginManager);
            }
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the MixedVoiceSynthesizer class.
        /// </summary>
        /// <param name="donator">Service provider the donator.</param>
        /// <param name="receiver">Service provider the receiver.</param>
        /// <param name="config">Config object.</param>
        public MixedVoiceSynthesizer(ServiceProvider donator, ServiceProvider receiver,
            MixedVoiceSynthesizerConfig config)
        {
            if (donator == null)
            {
                throw new ArgumentNullException("donator");
            }

            if (receiver == null)
            {
                throw new ArgumentNullException("receiver");
            }

            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            _donator = donator;
            _receiver = receiver;

            _config = config;

            _donator.Engine.AcousticProsodyTagger.Processed +=
                new EventHandler<TtsModuleEventArgs>(OnDonatorAcousticProcessed);

            _receiver.Engine.AcousticProsodyTagger.Processed +=
                new EventHandler<TtsModuleEventArgs>(OnReceiverAcousticProcessed);

            if (!string.IsNullOrEmpty(config.LogFile))
            {
                _logger = new TextLogger(config.LogFile);
                _logger.Reset();
            }
        }