Package com.sun.speech.freetts.relp

Examples of com.sun.speech.freetts.relp.SampleInfo


      loadBinary(is);
  } else {
      loadText(is);
  }
  is.close();
  sampleInfo = new SampleInfo(sampleRate, numChannels,
    residualFold, lpcMin, lpcRange, 0.0f);
    }
View Full Code Here


  if (targetRelation == null) {
      throw new IllegalStateException
    ("DiphonePitchmarkGenerator: Target relation does not exist");
  }

  SampleInfo sampleInfo;
  sampleInfo = (SampleInfo) utterance.getObject(SampleInfo.UTT_NAME);
  if (sampleInfo == null) {
      throw new IllegalStateException
    ("DiphonePitchmarkGenerator: SampleInfo does not exist");
  }
 
  float pos, f0, m = 0;
  float lf0 = utterance.getVoice().getPitch();
 
  double time = 0;
  int pitchMarks = 0// how many pitch marks

  LPCResult lpcResult;
  IntLinkedList timesList = new IntLinkedList();
 
  // first pass to count how many pitch marks will be required
  for (Item targetItem = targetRelation.getHead();
       targetItem != null; targetItem = targetItem.getNext()) {
      FeatureSet featureSet = targetItem.getFeatures();
      pos = featureSet.getFloat("pos");
      f0 = featureSet.getFloat("f0");
        //System.err.println("Target pos="+pos+", f0="+f0);
      if (time == pos) {
            lf0 = f0;
    continue;
      }
      m = (f0-lf0)/pos;
        //System.err.println("m=("+f0+"-"+lf0+")/"+pos+"="+m);
      for (; time < pos; pitchMarks++) {
    time += 1/(lf0 + (time * m));
        //System.err.println("f("+time+")="+((lf0+(time*m))));
    // save the time value in a list
    timesList.add((int) (time * sampleInfo.getSampleRate()));
      }
        lf0 = f0;
  }
  lpcResult = new LPCResult();
  // resize the number of frames to the number of pitchmarks
View Full Code Here

TOP

Related Classes of com.sun.speech.freetts.relp.SampleInfo

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.