コード例 #1
0
 /// <summary>
 /// Remove the unvoiced-voiced segment interval value.
 /// </summary>
 public void RemoveIntervalValue()
 {
     _interval = null;
 }
コード例 #2
0
        /// <summary>
        /// Generate the ScriptUvSeg object from the xml doc indicated by reader.
        /// </summary>
        /// <param name="reader">Xml text reader.</param>
        public void ParseFromXml(XmlTextReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            string type = reader.GetAttribute("type");
            _segType = FromStringToUvSegType(type);

            if (!reader.IsEmptyElement)
            {
                while (reader.Read())
                {
                    if (reader.NodeType == XmlNodeType.Element && reader.Name == "interval")
                    {
                        _interval = new ScriptUvSegInterval();
                        _interval.ParseFromXml(reader);
                    }
                    else if (reader.NodeType == XmlNodeType.Element && reader.Name == "f0")
                    {
                        _f0Contour = new ScriptF0Contour(reader.Name);
                        _f0Contour.ParseFromXml(reader);
                    }
                    else if (reader.NodeType == XmlNodeType.Element && reader.Name == "qf0")
                    {
                        _f0ContourQuantized = new ScriptF0Contour(reader.Name);
                        _f0ContourQuantized.ParseFromXml(reader);
                    }
                    else if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "uvseg")
                    {
                        break;
                    }
                }
            }
        }