-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
solution to ticket:133 -- created a new datatype REALISED_ACOUSTPARAM…
…S which is produced from AUDIO data -- the trick is to store the XML tree in the AUDIO mary data object, together with the actual audio data. Targets are adapted to store a reference to a Maryxml Element in addition to an utterance Item; the way these are filled at the moment is that Items in the Segment relation store a reference to the DOM Element they were created from, so the createTargets() code has an easy job in trying to align them. This means that from now on, we can start implementing XML-based target feature processors, in order to gradually remove the dependency of unit selection code on Utterance structures. UnitSelectionSynthesizer, after creating audio, queries the concatenation data objects filled by the unit concatenator, and updates phone and boundary durations in the XML file accordingly. Tested with unit selection only; should work with other WaveformSynthesizers as well, just for them, the same values as for ACOUSTPARAMS will be output in REALISED_ACOUSTPARAMS. The current method means that when requesting REALISED_ACOUSTPARAMS in addition to AUDIO, all processing steps will need to be computed twice; in the future, a caching mechanism can be used to make this more efficient. git-svn-id: https://mary.opendfki.de/repos/trunk@827 953a6561-930b-0410-b2a6-db37d1b2ae63
- Loading branch information
Showing
16 changed files
with
305 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
java/de/dfki/lt/mary/datatypes/REALISED_ACOUSTPARAMS_Definer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Copyright 2000-2006 DFKI GmbH. | ||
* All Rights Reserved. Use is subject to license terms. | ||
* | ||
* Permission is hereby granted, free of charge, to use and distribute | ||
* this software and its documentation without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of this work, and to | ||
* permit persons to whom this work is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* 1. The code must retain the above copyright notice, this list of | ||
* conditions and the following disclaimer. | ||
* 2. Any modifications must be clearly marked as such. | ||
* 3. Original authors' names are not deleted. | ||
* 4. The authors' names are not used to endorse or promote products | ||
* derived from this software without specific prior written | ||
* permission. | ||
* | ||
* DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH | ||
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE | ||
* CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL | ||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR | ||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS | ||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF | ||
* THIS SOFTWARE. | ||
*/ | ||
package de.dfki.lt.mary.datatypes; | ||
|
||
import de.dfki.lt.mary.MaryDataType; | ||
import de.dfki.lt.mary.MaryXML; | ||
|
||
/** | ||
* @author Marc Schröder | ||
* | ||
* | ||
*/ | ||
public class REALISED_ACOUSTPARAMS_Definer extends MaryDataType { | ||
static { | ||
define("REALISED_ACOUSTPARAMS", null, true, true, MARYXML, MaryXML.MARYXML, null, | ||
null); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
java/de/dfki/lt/mary/modules/RealisedAcoustparamsExtractor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/** | ||
* Copyright 2000-2006 DFKI GmbH. | ||
* All Rights Reserved. Use is subject to license terms. | ||
* | ||
* Permission is hereby granted, free of charge, to use and distribute | ||
* this software and its documentation without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of this work, and to | ||
* permit persons to whom this work is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* 1. The code must retain the above copyright notice, this list of | ||
* conditions and the following disclaimer. | ||
* 2. Any modifications must be clearly marked as such. | ||
* 3. Original authors' names are not deleted. | ||
* 4. The authors' names are not used to endorse or promote products | ||
* derived from this software without specific prior written | ||
* permission. | ||
* | ||
* DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH | ||
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE | ||
* CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL | ||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR | ||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS | ||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF | ||
* THIS SOFTWARE. | ||
*/ | ||
package de.dfki.lt.mary.modules; | ||
|
||
// DOM classes | ||
import java.util.ArrayList; | ||
import java.util.Iterator; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
import java.util.Locale; | ||
import java.util.Vector; | ||
|
||
import org.w3c.dom.Document; | ||
import org.w3c.dom.Element; | ||
import org.w3c.dom.traversal.DocumentTraversal; | ||
import org.w3c.dom.traversal.NodeFilter; | ||
import org.w3c.dom.traversal.NodeIterator; | ||
|
||
import de.dfki.lt.mary.MaryData; | ||
import de.dfki.lt.mary.MaryDataType; | ||
import de.dfki.lt.mary.MaryXML; | ||
import de.dfki.lt.mary.modules.synthesis.MBROLAPhoneme; | ||
import de.dfki.lt.mary.modules.synthesis.MbrolaVoice; | ||
import de.dfki.lt.mary.modules.synthesis.Voice; | ||
import de.dfki.lt.mary.util.MaryUtils; | ||
import de.dfki.lt.mary.util.dom.MaryDomUtils; | ||
import de.dfki.lt.mary.util.dom.NameNodeFilter; | ||
|
||
/** | ||
* Transforms a full MaryXML document into an MBROLA format string | ||
* | ||
* @author Marc Schröder | ||
*/ | ||
|
||
public class RealisedAcoustparamsExtractor extends InternalModule | ||
{ | ||
public RealisedAcoustparamsExtractor() | ||
{ | ||
super("Realised acoustparams extractor", | ||
MaryDataType.get("AUDIO"), | ||
MaryDataType.get("REALISED_ACOUSTPARAMS") | ||
); | ||
} | ||
|
||
public MaryData process(MaryData d) | ||
throws Exception | ||
{ | ||
Document doc = d.getDocument(); | ||
MaryData result = new MaryData(outputType()); | ||
result.setDocument(doc); | ||
return result; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.