|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TEXTTOSPEECHENGINE_H |
|
20 #define TEXTTOSPEECHENGINE_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <speechsynthesis.h> |
|
26 |
|
27 /** |
|
28 * Application engine |
|
29 */ |
|
30 class CTextToSpeechEngine : public CActive |
|
31 { |
|
32 public: // Constructors and destructor |
|
33 |
|
34 static CTextToSpeechEngine* NewL(); |
|
35 |
|
36 virtual ~CTextToSpeechEngine(); |
|
37 |
|
38 void InitAndPlayText( const TDesC& aText ); |
|
39 void InitAndPlayTextToFile( const TDesC& aText, |
|
40 const TFileName& aFileName ); |
|
41 |
|
42 void Play( ); |
|
43 void PauseL(); |
|
44 void StopL(); |
|
45 |
|
46 TInt VolumeL(); |
|
47 void SetVolumeL( TInt aVolume ); |
|
48 TInt MaxVolumeL(); |
|
49 |
|
50 TInt SpeakingRateL(); |
|
51 void SetSpeakingRateL( TInt aRate ); |
|
52 TInt MaxSpeakingRateL(); |
|
53 |
|
54 TVoice VoiceL(); |
|
55 void SetVoiceL( const TVoice& aVoice ); |
|
56 void GetLanguagesL( RArray<TLanguage>& aLanguages ); |
|
57 void GetVoicesL( RArray<TVoice>& aVoices, TLanguage aLanguage ); |
|
58 |
|
59 protected: // From CActive |
|
60 |
|
61 /** |
|
62 * CActive::RunL |
|
63 */ |
|
64 void RunL(); |
|
65 |
|
66 /** |
|
67 * CActive::DoCancel() |
|
68 */ |
|
69 void DoCancel(); |
|
70 |
|
71 private: |
|
72 |
|
73 CTextToSpeechEngine(); |
|
74 |
|
75 void ConstructL(); |
|
76 |
|
77 private: // Data |
|
78 |
|
79 enum TState |
|
80 { |
|
81 EIdle, |
|
82 EPriming, |
|
83 ESpeaking |
|
84 }; |
|
85 |
|
86 RSpeechSynthesis iServer; |
|
87 |
|
88 TState iState; |
|
89 |
|
90 TFileName iFileName; |
|
91 |
|
92 }; |
|
93 |
|
94 #endif |
|
95 |
|
96 // End of File |