Menu

IntegrationGuide

Timo Baumann

InproTK includes three entry points/runnable classes: SimpleReco, the main event-driven source for incremental processing, SimpleRTP which can be used to separate the computer providing speech input and the one which does all the processing, and SimpleMonitor which contains speech output capabilities.

Yet, many users will prefer to integrate some or all components in a more fine-grained manner, e.g. taking care of audio setup themselves rather than using InproTK's default ways. This document describes strategies for integration.

Integrating incremental speech synthesis

Projects that want to integrate (just) incremental speech output may set up a minimal synthesis environment as follows:

DispatchStream dispatcher = SimpleMonitor.setupDispatcher();
SynthesisModule iSS = new SynthesisModule(dispatcher);
// set up one's own IUModule that will be connected with iSS:
IUModule myIUmodule = new IUModule() {
    @Override
    protected void leftBufferUpdate(Collection<? extends IU> ius, List<? extends EditMessage<? extends IU>> edits) { /* we don't need this method */ }
};
myIUmodule.addListener(iSS);
// synthesize something:
myIUmodule.rightBuffer.addToBuffer(new PhraseIU("eins zwei drei vier fünf sechs sieben acht."));
myIUmodule.notifyListeners();
// this should be enough to start synthesis.

Projects that want to manipulate output before playing it, may do the following:

MaryAdapter ma = MaryAdapter.getInstance();
List<IU> wordIUs = ma.text2IUs("eins zwei drei vier fünf sechs sieben acht");
// manipulate IUs in whatever desired way
// start synthesis:
dispatcher.playStream(new DDS16kAudioInputStream(new VocodingAudioStream(new IUBasedFullPStream(wordIUs.get(0)), MaryAdapter5internal.getDefaultHMMData(), true)), true);
// wait for synthesis:
dispatcher.waitUntilDone();