de.dfki.lt.mary.modules
Class MaryXMLToMbrola

java.lang.Object
  extended by de.dfki.lt.mary.modules.InternalModule
      extended by de.dfki.lt.mary.modules.MaryXMLToMbrola
All Implemented Interfaces:
MaryModule

public class MaryXMLToMbrola
extends InternalModule

Transforms a full MaryXML document into an MBROLA format string

Author:
Marc Schröder

Field Summary
 
Fields inherited from class de.dfki.lt.mary.modules.InternalModule
logger, state
 
Fields inherited from interface de.dfki.lt.mary.modules.MaryModule
MODULE_OFFLINE, MODULE_RUNNING
 
Constructor Summary
MaryXMLToMbrola()
           
 
Method Summary
 java.lang.String convertToMbrola(java.util.List<org.w3c.dom.Element> phonemesAndBoundaries, Voice voice)
          Convert a given list of and elements into the MBROLA .pho format.
 void powerOnSelfTest()
          Perform a power-on self test by processing some example input data.
 MaryData process(MaryData d)
          Perform this module's processing on abstract "MaryData" input d.
 
Methods inherited from class de.dfki.lt.mary.modules.InternalModule
getState, inputType, name, outputType, shutdown, startup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaryXMLToMbrola

public MaryXMLToMbrola()
Method Detail

process

public MaryData process(MaryData d)
                 throws java.lang.Exception
Description copied from class: InternalModule
Perform this module's processing on abstract "MaryData" input d. Subclasses need to make sure that the process() method is thread-safe, because in server-mode, it will be called from different threads at the same time. A sensible way to do this seems to be not to use any global or static variables, or to use them read-only.

Specified by:
process in interface MaryModule
Overrides:
process in class InternalModule
Returns:
A MaryData object of type outputType() encapsulating the processing result.

This method just returns its input. Subclasses should override this.

Throws:
java.lang.Exception

convertToMbrola

public java.lang.String convertToMbrola(java.util.List<org.w3c.dom.Element> phonemesAndBoundaries,
                                        Voice voice)
Convert a given list of and elements into the MBROLA .pho format.

Throws:
java.lang.IllegalArgumentException - if one of the Elements in the List is not a or element or if the voice is not an MBROLA voice.

powerOnSelfTest

public void powerOnSelfTest()
                     throws java.lang.Error
Perform a power-on self test by processing some example input data. This module is actually tested as part of the MbrolaSynthesizer test, for which reason this method does nothing.

Specified by:
powerOnSelfTest in interface MaryModule
Overrides:
powerOnSelfTest in class InternalModule
Throws:
java.lang.Error - if the module does not work properly.