xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
QTextToSpeech.x
浏览该文件的文档.
1//xlang Source, Name:qt5/widgets/QTextToSpeech.x
2//Date: Tue Apr 18:36:02 2023
3package Qt{
4 @SuppressWarnings public class QTextToSpeech : QObject{
5 public enum State {
6 Ready,
7 Speaking,
8 Paused,
9 BackendError
10 };
11
12 public QTextToSpeech(){
13
14 }
15
16 public QTextToSpeech(long handle){
17 super(handle);
18 }
19
20 public bool create(){
21 nativehandle = QtXnl.createQObject(QType.qtTextToSpeech, this, 0l);
22 if (nativehandle == 0){
23 return false;
24 }
25 return true;
26 }
27
28 public bool create(@NotNilptr QObject parent){
29 nativehandle = QtXnl.createQObject(QType.qtTextToSpeech, this, parent != nilptr ? parent.nativehandle : 0l);
30 if (nativehandle == 0){
31 return false;
32 }
33 return true;
34 }
35
36 public bool create(@NotNilptr String strEngine, @NotNilptr QObject parent){
37 nativehandle = QtXnl.createQSObject(QType.qtTextToSpeech, this, parent != nilptr ? parent.nativehandle : 0l, strEngine);
38 if (nativehandle == 0){
39 return false;
40 }
41 return true;
42 }
43
44 public static String [] availableEngines(){
45 return (String[]) QtXnl.object_get_handle(0, Constant.QTEXTTOSPEECH_AVAILABLEENGINES, (long)0);
46 }
47
48 public void say(String text){
49 QtXnl.widget_slot_string(nativehandle, Constant.QTEXTTOSPEECH_SAY, text);
50 }
51 public void stop(){
52 QtXnl.widget_slot(nativehandle, Constant.QTEXTTOSPEECH_STOP);
53 }
54 public void pause(){
55 QtXnl.widget_slot(nativehandle, Constant.QTEXTTOSPEECH_PAUSE);
56 }
57 public void resume(){
58 QtXnl.widget_slot(nativehandle, Constant.QTEXTTOSPEECH_RESUME);
59 }
60
61 public void setLanguage(Language language){
62 QtXnl.widget_set_vint_value(nativehandle, Constant.QTEXTTOSPEECH_SETLANGUAGELOCALE, language.value());
63 }
64
65 public void setRate(double rate){
66 QtXnl.widget_set_double_value(nativehandle, Constant.QTEXTTOSPEECH_SETRATE, rate);
67 }
68 public void setPitch(double pitch){
69 QtXnl.widget_set_double_value(nativehandle, Constant.QTEXTTOSPEECH_SETPITCH, pitch);
70 }
71 public void setVolume(double volume){
72 QtXnl.widget_set_double_value(nativehandle, Constant.QTEXTTOSPEECH_SETVOLUME, volume);
73 }
74
75 public State state(){
76 return (State)QtXnl.widget_get_int_value(nativehandle, Constant.QTEXTTOSPEECH_STATE);
77 }
78
79 public Language getLanguage(){
80 return (Language)QtXnl.widget_get_int_value(nativehandle, Constant.QTEXTTOSPEECH_GETLANGUAGE);
81 }
82
83 public double rate() {
84 return QtXnl.widget_get_double_value(nativehandle, Constant.QTEXTTOSPEECH_RATE);
85 }
86
87 public double pitch(){
88 return QtXnl.widget_get_double_value(nativehandle, Constant.QTEXTTOSPEECH_PITCH);
89 }
90
91 public double volume() {
92 return QtXnl.widget_get_double_value(nativehandle, Constant.QTEXTTOSPEECH_VOLUME);
93 }
94 };
95};
void setPitch(double pitch)
static String [] availableEngines()
bool create(@NotNilptr String strEngine, @NotNilptr QObject parent)
Language getLanguage()
void setVolume(double volume)
void setRate(double rate)
QTextToSpeech(long handle)
void say(String text)
void setLanguage(Language language)
bool create(@NotNilptr QObject parent)
字符串类