public void startup() throws Exception { super.startup(); // We depend on the Synthesis module: MaryModule synthesis; try { synthesis = ModuleRegistry.getModule(marytts.modules.Synthesis.class); } catch (NullPointerException npe) { synthesis = new Synthesis(); } assert synthesis != null; if (synthesis.getState() == MaryModule.MODULE_OFFLINE) synthesis.startup(); // load klatt rules klattRuleParams = new Properties(); klattRuleParams.load(new FileInputStream(MaryProperties.needFilename(localePrefix + ".cap.klattrulefile"))); // load phone list allophoneSet = MaryRuntimeUtils.needAllophoneSet(localePrefix + ".allophoneset"); klattDurationParams = new KlattDurationModeller.KlattDurationParams(MaryProperties.needFilename(localePrefix + ".cap.klattdurfile")); // instantiate the Map in which settings are associated with elements: // (when the objects serving as keys are not in ordinary use any more, // the key-value pairs are deleted from the WeakHashMap earlier or // later; that means we do not need to keep track of the hashmaps per // thread) prosodyMap = new WeakHashMap(); }
private int getInhDuration(Element segment) { return klattDurationParams.getInhDuration(segment.getAttribute("p")); }
private int getMinDuration(Element segment) { int minDuration = klattDurationParams.getMinDuration(segment.getAttribute("p")); // additional reduction for unstressed segments: // (this comes from klatt's original rule no. 7) if (getStress(getSyllable(segment)) == 0) { // For unstressed segments, // increase stretchability by reducing minimum duration: return (minDuration * getPropertyAsInteger("rule7.mindur")) / 100; } else { // default return minDuration; } }
public void startup() throws Exception { super.startup(); // We depend on the Synthesis module: MaryModule synthesis; try { synthesis = ModuleRegistry.getModule(marytts.modules.Synthesis.class); } catch (NullPointerException npe) { synthesis = new Synthesis(); } assert synthesis != null; if (synthesis.getState() == MaryModule.MODULE_OFFLINE) synthesis.startup(); // load klatt rules klattRuleParams = new Properties(); klattRuleParams.load(new FileInputStream(MaryProperties.needFilename(localePrefix + ".cap.klattrulefile"))); // load phone list allophoneSet = MaryRuntimeUtils.needAllophoneSet(localePrefix + ".allophoneset"); klattDurationParams = new KlattDurationModeller.KlattDurationParams(MaryProperties.needFilename(localePrefix + ".cap.klattdurfile")); // instantiate the Map in which settings are associated with elements: // (when the objects serving as keys are not in ordinary use any more, // the key-value pairs are deleted from the WeakHashMap earlier or // later; that means we do not need to keep track of the hashmaps per // thread) prosodyMap = new WeakHashMap(); }
private int getInhDuration(Element segment) { return klattDurationParams.getInhDuration(segment.getAttribute("p")); }
private int getMinDuration(Element segment) { int minDuration = klattDurationParams.getMinDuration(segment.getAttribute("p")); // additional reduction for unstressed segments: // (this comes from klatt's original rule no. 7) if (getStress(getSyllable(segment)) == 0) { // For unstressed segments, // increase stretchability by reducing minimum duration: return (minDuration * getPropertyAsInteger("rule7.mindur")) / 100; } else { // default return minDuration; } }
public void startup() throws Exception { super.startup(); // We depend on the Synthesis module: MaryModule synthesis; try { synthesis = ModuleRegistry.getModule(marytts.modules.Synthesis.class); } catch (NullPointerException npe) { synthesis = new Synthesis(); } assert synthesis != null; if (synthesis.getState() == MaryModule.MODULE_OFFLINE) synthesis.startup(); // load klatt rules klattRuleParams = new Properties(); klattRuleParams.load(new FileInputStream(MaryProperties.needFilename(localePrefix + ".cap.klattrulefile"))); // load phone list allophoneSet = MaryRuntimeUtils.needAllophoneSet(localePrefix + ".allophoneset"); klattDurationParams = new KlattDurationModeller.KlattDurationParams(MaryProperties.needFilename(localePrefix + ".cap.klattdurfile")); // instantiate the Map in which settings are associated with elements: // (when the objects serving as keys are not in ordinary use any more, // the key-value pairs are deleted from the WeakHashMap earlier or // later; that means we do not need to keep track of the hashmaps per // thread) prosodyMap = new WeakHashMap(); }
private int getInhDuration(Element segment) { return klattDurationParams.getInhDuration(segment.getAttribute("p")); }
private int getMinDuration(Element segment) { int minDuration = klattDurationParams.getMinDuration(segment.getAttribute("p")); // additional reduction for unstressed segments: // (this comes from klatt's original rule no. 7) if (getStress(getSyllable(segment)) == 0) { // For unstressed segments, // increase stretchability by reducing minimum duration: return (minDuration * getPropertyAsInteger("rule7.mindur")) / 100; } else { // default return minDuration; } }