General NSSTTS APIs
Jump to: navigation, search
CS001033
Device, software version:
S60 3rd Edition, FP2
Detailed description
This API is not part of the public API, which can be found in sdk api Plug-in.
Here, TTS APIs define the common data types required by TTS. This type covers text data segmentation and Speech Style. The TTS common module must be used in the TTS client application.
Header file
#include <nssttscommon.h>
Link Library
LIBRARY nssttscommon.lib
Sample Code
TTS style information
This attribute can be used to set the synthesis language, the reader's age, and so on.
TTtsStyle iStyle;
TTtsStyleID iStyleId;
// Use high quality TTS
iStyle.iQuality = ETtsQualityHighOnly;
// Use language and speaker set in Speech application.
// Also speaking rate and volume is set according to Speech app.
iStyle.iLanguage = KTtsUndefinedLanguage;
// Add style
iStyleId = iTtsUtility->AddStyleL( iStyle );// where iTtsutility is CTtsUtility
Text Segmentation Information
This class records segment information
TTtsSegment iSegment;
iSegment.SetStyleID( iStyleId ); // Sets the style for a segment.
//The style cannot be deleted during the lifetime of this object.
iSegment.SetTextPtr( iParsedText->Text() );//Sets a text pointer.
//The text cannot be deleted during the lifetime of this object.
CTtsParsedText
Here, the CTtsParsedText Class records the TTS decomposition text. This class has text and related phoneme sequences (used for pattern recognition) and segmented information.
Add paragraph
Adds or inserts a new paragraph. The paragraph must be added to the correct position. That is, the text and phoneme sequence must follow each other. You can delete this section after the function returns.
CTtsParsedText* iParsedText = CTtsParsedText::NewL();
// Set text
iParsedText->SetTextL( KText1 );
iParsedText->AddSegmentL( iSegment, 0 );
Delete the number of paragraphs and paragraphs
if ( iParsedText->NumberOfSegments() > 0 )
{
// Remove existing segment from parsed text structure
iParsedText->DeleteSegmentL( 0 );
}
Retrieved from "http://www.developer.nokia.com/Community/Wiki/NSSTTS%E9%80%9A%E7%94%A8API"
Comments
(No comments yet)