Maintaining word positions when synthesizing large playbacks

Last reviewed: 9/10/2008

HOW Article ID: H090811

The information in this article applies to:

  • SpeechKit 6


For efficiency, it is recommended to split up large synthesis requests into multiple smaller requests. However, the word position events that fire during synthesis are relative to the beginning of the request and not the original body of text.

With SpeechKit 6, the offset of the original request text can be passed in with the request and the event position values are automatically offset by this value.

More Information

It is recommended for applications that synthesize speech from documents or large text containers that the text be broken up into reasonable sized requests to not only balance processing loads, but also to enable greater end user control over playback options.

However, once a request is synthesized, the word position events fired by the synthesizer are relative to the request not the original text container.

In SpeechKit 6, the ChantTTS StartPlayback method now interprets the length parameter for text playback requests (CPOText) as word offset value. It will be added to the word position events. If you have been passing the length of your playback string in your application, you want to change that value to 0 or the actually offset of the text within your text container for correct word position event values. The following example illustrates using the word offset value:

This is the first sentence. This is the second sentence.

ChantTTS.StartPlayback("This is the first sentence.",0,CPOText)
ChantTTS.StartPlayback("This is the second sentence.", 28, CPOText);

In addition, SpeechKit 6 file playback has been optimized with a better file read and playback approach to better support large file synthesis requests as illustrated in the following request:

ChantTTS.StartPlayback("c:\\pathtomyfile\\mylargefile.txt";, 0, CPOFile, CAFText)