Examples of SampleSet


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

     *
     * @return the nearest Sample
     */
    public Sample getNearestSample(float index) {
  int i, iSize = 0, nSize;
  SampleSet sts = db.getSts();

  // loop through all the Samples in this unit
  for (i = start; i < end; i++) {
      Sample sample = sts.getSample(i);
      nSize = iSize + sample.getResidualSize();

      if (Math.abs(index - (float) iSize) <
    Math.abs(index - (float) nSize)) {
    return sample;
      }
      iSize = nSize;
  }
  return sts.getSample(end - 1);
    }
View Full Code Here

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

    joinWeightShift = calcJoinWeightShift(joinWeights);

      } else if (tag.equals("STS")) {
    String name = tokenizer.nextToken();
    if (name.equals("STS")) {
        sts = new SampleSet(tokenizer, reader);
    } else {
        mcep = new SampleSet(tokenizer, reader);
    }
      } else if (tag.equals("UNITS")) {
    int type = Integer.parseInt(tokenizer.nextToken());
    int phone = Integer.parseInt(tokenizer.nextToken());
    int start = Integer.parseInt(tokenizer.nextToken());
View Full Code Here

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

  int unitTypesLength = bb.getInt();
  unitTypes = new UnitType[unitTypesLength];
  for (int i = 0; i < unitTypes.length; i++) {
      unitTypes[i] = new UnitType(bb);
  }
  sts = new SampleSet(bb);
  mcep = new SampleSet(bb);

  int numCarts = bb.getInt();
  cartMap = new HashMap();
  for (int i = 0; i < numCarts; i++) {
      String name = Utilities.getString(bb);
View Full Code Here

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

  int unitTypesLength = is.readInt();
  unitTypes = new UnitType[unitTypesLength];
  for (int i = 0; i < unitTypes.length; i++) {
      unitTypes[i] = new UnitType(is);
  }
  sts = new SampleSet(is);
  mcep = new SampleSet(is);

  int numCarts = is.readInt();
  cartMap = new HashMap();
  for (int i = 0; i < numCarts; i++) {
      String name = Utilities.getString(is);
View Full Code Here

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

  int uttSize = 0;
  int unitEntry;
  int unitStart;
  int unitEnd;

  SampleSet sts = (SampleSet) utterance.getObject("sts_list");
  lpcResult = new LPCResult();

  for (Item unit = utterance.getRelation(Relation.UNIT).getHead();
    unit != null; unit = unit.getNext()) {
      unitEntry = unit.getFeatures().getInt("unit_entry");
      unitStart = unit.getFeatures().getInt("unit_start");
      unitEnd = unit.getFeatures().getInt("unit_end");
      uttSize += sts.getUnitSize(unitStart, unitEnd);
      pitchmarks += unitEnd - unitStart;
      unit.getFeatures().setInt("target_end", uttSize);
  }

  lpcResult.resizeFrames(pitchmarks);

  pitchmarks = 0;
  uttSize = 0;

  int[] targetTimes = lpcResult.getTimes();

  for (Item unit = utterance.getRelation(Relation.UNIT).getHead();
    unit != null; unit = unit.getNext()) {
      unitEntry = unit.getFeatures().getInt("unit_entry");
      unitStart = unit.getFeatures().getInt("unit_start");
      unitEnd = unit.getFeatures().getInt("unit_end");
      for (int i = unitStart; i < unitEnd; i++,pitchmarks++) {
    uttSize += sts.getSample(i).getResidualSize();
    targetTimes[pitchmarks] = uttSize;
      }
  }
  utterance.setObject("target_lpcres", lpcResult);
    }
View Full Code Here

Examples of org.opentripplanner.analyst.SampleSet

        final PointSet pset = server.pointSetCache.get(targetPointSetId);
        if (pset == null) return badRequest("Missing or invalid target PointSet ID.");
       
        //TODO cache this sampleset
        Graph gg = server.graphService.getGraph(surf.routerId);
        SampleSet samples = pset.getSampleSet( gg );
       
        final ResultFeature indicator = new ResultFeature(samples, surf);
        if (indicator == null) return badServer("Could not compute indicator as requested.");
        return Response.ok().entity(new StreamingOutput() {
            @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.