/// <summary> /// Gets acoustic feature name string from HMMM model type. /// </summary> /// <param name="modelType">HMM model type.</param> /// <returns>Acoustic feature string.</returns> public static string GetAcousticFeatureName(HmmModelType modelType) { if (AcousticFeatureNames.ContainsValue(modelType)) { return AcousticFeatureNames.Single(n => n.Value == modelType).Key; } else { return string.Empty; } }
/// <summary> /// Set the customized generation settings. /// </summary> /// <param name="f0CustomizedGeneration">The customized generation setting for F0 stream.</param> /// <param name="modelType">The model which will be handled by customized generation module.</param> public void SetCustomizationSetting(HtsF0CustomizedGeneration f0CustomizedGeneration, HmmModelType modelType) { HtsModel model = Models[modelType]; model.Header.F0CustomizedGeneration = f0CustomizedGeneration; }
/// <summary> /// Initializes a new instance of the HtsMmfFile class. /// </summary> /// <param name="modelType">Model type of this file.</param> public HtsMmfFile(HmmModelType modelType) { _modelType = modelType; }
/// <summary> /// Get model mapping set . /// </summary> /// <param name="type">The hmm model type.</param> /// <returns>Model mapping set.</returns> public ModelMappingSet GetModelMappingSet(HmmModelType type) { ModelMappingSet model = null; foreach (ModelMappingSet set in _modelMappingSets) { if (set.ModelType == type) { model = set; break; } } return model; }
/// <summary> /// Create Gaussian serializer. /// </summary> /// <param name="config">Gaussian configuration.</param> /// <param name="modelType">Model type.</param> /// <param name="modelDistribution">Model distribution.</param> /// <returns>Gaussian serializer.</returns> public static GaussianSerializer Create(GaussianConfig config, HmmModelType modelType, ModelDistributionType modelDistribution) { Helper.ThrowIfNull(config); GaussianSerializer serializer = null; if (config.IsFixedPoint) { if (modelType == HmmModelType.Lsp) { serializer = new FixedPointLspGaussianSerializer(config); } else if (modelType == HmmModelType.FundamentalFrequency) { serializer = new FixedPointF0GaussianSerializer(config); } else if (modelType == HmmModelType.Mbe) { serializer = new FixedPointMBEGaussianSerializer(config); } } if (serializer == null) { if (modelDistribution == ModelDistributionType.Msd) { serializer = new MultipleSpaceDistributionGaussianSerializer(config); } else { serializer = new GaussianSerializer(config); } } return serializer; }
/// <summary> /// Gets label string from HMMM model type. /// </summary> /// <param name="modelType">HMM model type.</param> /// <returns>Label string.</returns> public static string GetModelLabel(HmmModelType modelType) { string modelTag = string.Empty; switch (modelType) { case HmmModelType.Lsp: modelTag = "LSP"; break; case HmmModelType.FundamentalFrequency: modelTag = "LogF0"; break; case HmmModelType.StateDuration: modelTag = "StateDuration"; break; case HmmModelType.PhoneDuration: modelTag = "PhoneDuration"; break; case HmmModelType.Power: modelTag = "Power"; break; case HmmModelType.Mbe: modelTag = "MultiBandExcitation"; break; case HmmModelType.GuidanceLsp: modelTag = "GuidanceLsp"; break; } return modelTag; }