Package com.sun.speech.freetts

Examples of com.sun.speech.freetts.PhoneDuration


     * @throws ProcessException if a problem is encountered during the
     *         processing of the utterance
     */
    public void processUtterance(Utterance utterance) throws ProcessException {
        float durStretch;
        PhoneDuration durStat;
        float durationStretch = utterance.getVoice().getDurationStretch();
        float zdur;
        float dur;
        float end = 0.0f;
  float localDurationStretch;
       
        // Figure out how far to stretch the durations (speed things
        // up or slow them down.
        //

  durStretch = meanRate / utterance.getVoice().getRate();

        // Go through each of the segments and calculate a duration
        // for it.  Store the cumulative end time for the duration in
        // the "end" feature of the segment.
        //
  for (Item segment =
                 utterance.getRelation(Relation.SEGMENT).getHead();
    segment != null; segment = segment.getNext()) {
            zdur = ((Float) cart.interpret(segment)).floatValue();
            durStat = durations.getPhoneDuration(
                segment.getFeatures().getString("name"));

      Object tval = DURATION_STRETCH_PATH.findFeature(segment);
      localDurationStretch = Float.parseFloat(tval.toString());

      if (localDurationStretch == 0.0) {
    localDurationStretch = durationStretch;
      } else {
    localDurationStretch *= durationStretch;
      }

            dur = localDurationStretch * ((zdur*durStat.getStandardDeviation())
                                 + durStat.getMean());
            end += dur;
            segment.getFeatures().setFloat("end", end);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.speech.freetts.PhoneDuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.