CDevTTS Class Reference

class CDevTTS : public CBase

CDevTTS is the interface towards DevTTS module. Actual implementation is not included in this class.

nssdevtts.lib
Since
2.8

Inherits from

Public Member Functions
~CDevTTS()
IMPORT_C TTtsStyleIDAddStyleL(const TTtsStyle &)
IMPORT_C TIntBalance()
IMPORT_C voidBufferProcessed(const TDesC8 &)
IMPORT_C TAny *CustomInterface(TUid)
IMPORT_C voidDeleteStyleL(TTtsStyleID)
IMPORT_C voidGetPositionL(TTimeIntervalMicroSeconds &)
IMPORT_C voidGetPositionL(TTtsSegment &, TInt &)
IMPORT_C TBoolIsLanguageSupported(TLanguage)
IMPORT_C voidLanguageIdentificationL(CTtsParsedText &, TInt, RArray< TLanguage > &, RArray< TInt > &)
IMPORT_C TIntMaxVolume()
IMPORT_C CDevTTS *NewL(MDevTTSObserver &)
IMPORT_C voidNormalizeAndSegmentTextL(CTtsParsedText &)
IMPORT_C voidNormalizeTextL(CTtsParsedText &)
IMPORT_C TUint16NumberOfStyles()
IMPORT_C voidPause()
IMPORT_C voidPrimeSynthesisL(MTtsSegmentStream &)
IMPORT_C voidPrimeSynthesisL(CTtsParsedText &)
IMPORT_C voidSetAudioOutputL(TInt)
IMPORT_C voidSetAudioPriority(TInt, TDevTTSAudioPreference)
IMPORT_C voidSetBalance(TInt)
IMPORT_C voidSetPositionL(const TTimeIntervalMicroSeconds &)
IMPORT_C voidSetPositionL(const TTtsSegment &, TInt)
IMPORT_C voidSetVolume(TInt)
IMPORT_C voidSetVolumeRamp(const TTimeIntervalMicroSeconds &)
IMPORT_C voidStop()
IMPORT_C TTtsStyle &StyleL(TTtsStyleID)
IMPORT_C TTtsStyle &StyleL(TUint16)
IMPORT_C voidSynthesizeL(TDevTTSOutputMode)
IMPORT_C TIntVolume()
Private Member Functions
CDevTTS()
CDevTTS(const CDevTTS &)
voidConstructL(MDevTTSObserver &)
CDevTTS &operator=(const CDevTTS &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
CTTSAlgorithmManager *iImpl
TAny *iReserved

Constructor & Destructor Documentation

CDevTTS()

CDevTTS()[private]

C++ default constructor.

CDevTTS(const CDevTTS &)

CDevTTS(const CDevTTS &)[private]

Prohibit copy constructor

Parameters

const CDevTTS &

~CDevTTS()

IMPORT_C~CDevTTS()

Destructor.

Member Functions Documentation

AddStyleL(const TTtsStyle &)

IMPORT_C TTtsStyleIDAddStyleL(const TTtsStyle &aStyle)

Adds a new style to the collection. If equal style exists already, new style is not added. Will leave if an error occurs. Likely errors are: KErrNoMemory, not enough memory to add new style. KErrNotSupported, the style is not supported. KErrArgument, the style contains an imposible value.

Since
2.8

Parameters

const TTtsStyle & aStyle

Balance()

IMPORT_C TIntBalance()

Returns the current balance setting.

Since
2.8

BufferProcessed(const TDesC8 &)

IMPORT_C voidBufferProcessed(const TDesC8 &aBuffer)

Notifies that the buffer has been processed. The method is used if output mode of synthesizing is EDevTTSClientMode.

Since
2.8

Parameters

const TDesC8 & aBuffer

ConstructL(MDevTTSObserver &)

voidConstructL(MDevTTSObserver &aObserver)[private]

By default Symbian 2nd phase constructor is private.

Parameters

MDevTTSObserver & aObserver

CustomInterface(TUid)

IMPORT_C TAny *CustomInterface(TUidaInterfaceID)

Request a pointer to the custom interface. Currently not in use.

Since
2.8

Parameters

TUid aInterfaceID

DeleteStyleL(TTtsStyleID)

IMPORT_C voidDeleteStyleL(TTtsStyleIDaStyleID)

Deletes style.

Since
2.8

Parameters

TTtsStyleID aStyleID

GetPositionL(TTimeIntervalMicroSeconds &)

IMPORT_C voidGetPositionL(TTimeIntervalMicroSeconds &aTime)const

Gives current position of synthesizing. The method will leave if an error occurs. Likely errors are: KErrNotReady, no synthesizing is ongoing.

Since
2.8

Parameters

TTimeIntervalMicroSeconds & aTime

GetPositionL(TTtsSegment &, TInt &)

IMPORT_C voidGetPositionL(TTtsSegment &aSegment,
TInt &aWordIndex
)const

Gives current position of synthesizing. The method will leave if an error occurs. Likely errors are: KErrNotReady, no synthesizing is ongoing.

Since
2.8

Parameters

TTtsSegment & aSegment
TInt & aWordIndex

IsLanguageSupported(TLanguage)

IMPORT_C TBoolIsLanguageSupported(TLanguageaLanguage)const

Tells if language is supported by the TTS engine or not.

Since
2.8

Parameters

TLanguage aLanguage

LanguageIdentificationL(CTtsParsedText &, TInt, RArray< TLanguage > &, RArray< TInt > &)

IMPORT_C voidLanguageIdentificationL(CTtsParsedText &aText,
TIntaNumberOfGuesses,
RArray< TLanguage > &aLanguages,
RArray< TInt > &aScores
)

Calls language identification for a given text.

Since
3.0M

Parameters

CTtsParsedText & aText
TInt aNumberOfGuesses
RArray< TLanguage > & aLanguages
RArray< TInt > & aScores

MaxVolume()

IMPORT_C TIntMaxVolume()

Returns maximum volume value.

Since
2.8

NewL(MDevTTSObserver &)

IMPORT_C CDevTTS *NewL(MDevTTSObserver &aObserver)[static]

Two-phased constructor.

Parameters

MDevTTSObserver & aObserver

NormalizeAndSegmentTextL(CTtsParsedText &)

IMPORT_C voidNormalizeAndSegmentTextL(CTtsParsedText &aText)

Calls Natural Language Processing (NLP) to normalize and segment text.

Since
3.0M

Parameters

CTtsParsedText & aText

NormalizeTextL(CTtsParsedText &)

IMPORT_C voidNormalizeTextL(CTtsParsedText &aText)

Calls Natural Language Processing (NLP) to normalize text.

Since
3.0M

Parameters

CTtsParsedText & aText

NumberOfStyles()

IMPORT_C TUint16NumberOfStyles()const

Gives number of styles.

Since
2.8

Pause()

IMPORT_C voidPause()
Pauses synthesis process.
Since
2.8

PrimeSynthesisL(MTtsSegmentStream &)

IMPORT_C voidPrimeSynthesisL(MTtsSegmentStream &aStream)

Prepares for synthesis. The method will leave if an error occurs. Likely errors are: KErrInUse, synthesizing is currently ongoing. KErrNoMemory, not enough memory to start synthesis. KErrNotSupport, requested function is not supported.

Since
2.8

Parameters

MTtsSegmentStream & aStream

PrimeSynthesisL(CTtsParsedText &)

IMPORT_C voidPrimeSynthesisL(CTtsParsedText &aText)

Prepares for synthesis. The method will leave if an error occurs. Likely errors are: KErrInUse, synthesizing is currently ongoing. KErrNoMemory, not enough memory to start synthesis. KErrNotSupport, requested function is not supported.

Since
2.8

Parameters

CTtsParsedText & aText

SetAudioOutputL(TInt)

IMPORT_C voidSetAudioOutputL(TIntaAudioOutput)

Sets the audio output routing

Since
3.2

Parameters

TInt aAudioOutput

SetAudioPriority(TInt, TDevTTSAudioPreference)

IMPORT_C voidSetAudioPriority(TIntaPriority,
TDevTTSAudioPreferenceaPref
)

Sets the priority for audio playback if in EDevTTSSoundDeviceMode.

Since
2.8

Parameters

TInt aPriority
TDevTTSAudioPreference aPref

SetBalance(TInt)

IMPORT_C voidSetBalance(TIntaBalance)

Sets the playback device balance. Affects only when DevTTS is in EDevTTSSoundDeviceMode. Illegal values are neglected.

Since
2.8

Parameters

TInt aBalance

SetPositionL(const TTimeIntervalMicroSeconds &)

IMPORT_C voidSetPositionL(const TTimeIntervalMicroSeconds &aTime)

Sets new position for synthesizing. The method will leave if an error occurs. Likely errors are: KErrNotReady, no synthesizing is ongoing. KErrArgument, position cannot be set.

Since
2.8

Parameters

const TTimeIntervalMicroSeconds & aTime

SetPositionL(const TTtsSegment &, TInt)

IMPORT_C voidSetPositionL(const TTtsSegment &aSegment,
TIntaWordIndex
)

Sets new position for synthesizing. The method will leave if an error occurs. Likely errors are: KErrNotReady, no synthesizing is ongoing. KErrArgument, position cannot be set.

Since
2.8

Parameters

const TTtsSegment & aSegment
TInt aWordIndex

SetVolume(TInt)

IMPORT_C voidSetVolume(TIntaVolume)

Sets the playback device volume. Affects only when DevTTS is in EDevTTSSoundDeviceMode. Range is from 0..MaxVolume(). Illegal values are neglected.

Since
2.8

Parameters

TInt aVolume

SetVolumeRamp(const TTimeIntervalMicroSeconds &)

IMPORT_C voidSetVolumeRamp(const TTimeIntervalMicroSeconds &aRampDuration)

Sets the volume ramp duration. Start and end volumes must be set with SetVolume() function.

Since
2.8

Parameters

const TTimeIntervalMicroSeconds & aRampDuration

Stop()

IMPORT_C voidStop()
Stops synthesizing and releases resources of synthesizing. The method does nothing if already stopped.
Since
2.8

StyleL(TTtsStyleID)

IMPORT_C TTtsStyle &StyleL(TTtsStyleIDaStyleID)const

Receives style information. The method will leave if an error occurs. Likely errors are: KErrNotFound, style identifier not found.

Since
2.8

Parameters

TTtsStyleID aStyleID

StyleL(TUint16)

IMPORT_C TTtsStyle &StyleL(TUint16aIndex)const

Receives style information. The method will leave if an error occurs. Likely errors are: KErrArgument, index is out of bounds.

Since
2.8

Parameters

TUint16 aIndex

SynthesizeL(TDevTTSOutputMode)

IMPORT_C voidSynthesizeL(TDevTTSOutputModeaOutputMode)

Starts synthesizing the text. The method is asynchronous, as soon as the request has been placed, function call will return. MDevTTSObserver::MdtoEvent will be called when synthesizing finishes. The method will leave if an error occurs. Likely errors are: KErrNoMemory, not enough memory. KErrInUse, synthesizing is currently ongoing

Since
2.8

Parameters

TDevTTSOutputMode aOutputMode

Volume()

IMPORT_C TIntVolume()

Returns current playback volume.

Since
2.8

operator=(const CDevTTS &)

CDevTTS &operator=(const CDevTTS &)[private]

Prohibit assignment operator

Parameters

const CDevTTS &

Member Data Documentation

CTTSAlgorithmManager * iImpl

CTTSAlgorithmManager *iImpl[private]

TAny * iReserved

TAny *iReserved[private]