UniMRCP  1.3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mrcp_synth_header.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2014 Arsen Chaloyan
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Id: mrcp_synth_header.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17  */
18 
19 #ifndef MRCP_SYNTH_HEADER_H
20 #define MRCP_SYNTH_HEADER_H
21 
22 /**
23  * @file mrcp_synth_header.h
24  * @brief MRCP Synthesizer Header
25  */
26 
27 #include "mrcp_types.h"
28 #include "mrcp_header_accessor.h"
29 
31 
32 /** MRCP synthesizer header fields */
33 typedef enum {
34  SYNTHESIZER_HEADER_JUMP_SIZE,
35  SYNTHESIZER_HEADER_KILL_ON_BARGE_IN,
36  SYNTHESIZER_HEADER_SPEAKER_PROFILE,
37  SYNTHESIZER_HEADER_COMPLETION_CAUSE,
38  SYNTHESIZER_HEADER_COMPLETION_REASON,
39  SYNTHESIZER_HEADER_VOICE_GENDER,
40  SYNTHESIZER_HEADER_VOICE_AGE,
41  SYNTHESIZER_HEADER_VOICE_VARIANT,
42  SYNTHESIZER_HEADER_VOICE_NAME,
43  SYNTHESIZER_HEADER_PROSODY_VOLUME,
44  SYNTHESIZER_HEADER_PROSODY_RATE,
45  SYNTHESIZER_HEADER_SPEECH_MARKER,
46  SYNTHESIZER_HEADER_SPEECH_LANGUAGE,
47  SYNTHESIZER_HEADER_FETCH_HINT,
48  SYNTHESIZER_HEADER_AUDIO_FETCH_HINT,
49  SYNTHESIZER_HEADER_FAILED_URI,
50  SYNTHESIZER_HEADER_FAILED_URI_CAUSE,
51  SYNTHESIZER_HEADER_SPEAK_RESTART,
52  SYNTHESIZER_HEADER_SPEAK_LENGTH,
53  SYNTHESIZER_HEADER_LOAD_LEXICON,
54  SYNTHESIZER_HEADER_LEXICON_SEARCH_ORDER,
55 
56  SYNTHESIZER_HEADER_COUNT
58 
59 
60 /** Speech-units */
61 typedef enum {
62  SPEECH_UNIT_SECOND,
63  SPEECH_UNIT_WORD,
64  SPEECH_UNIT_SENTENCE,
65  SPEECH_UNIT_PARAGRAPH,
66 
67  SPEECH_UNIT_COUNT
69 
70 /** Speech-length types */
71 typedef enum {
72  SPEECH_LENGTH_TYPE_TEXT,
73  SPEECH_LENGTH_TYPE_NUMERIC_POSITIVE,
74  SPEECH_LENGTH_TYPE_NUMERIC_NEGATIVE,
75 
76  SPEECH_LENGTH_TYPE_UNKNOWN
78 
79 /** MRCP voice-gender */
80 typedef enum {
81  VOICE_GENDER_MALE,
82  VOICE_GENDER_FEMALE,
83  VOICE_GENDER_NEUTRAL,
84 
85  VOICE_GENDER_COUNT,
86  VOICE_GENDER_UNKNOWN = VOICE_GENDER_COUNT
88 
89 /** Prosody-volume type */
90 typedef enum {
91  PROSODY_VOLUME_TYPE_LABEL,
92  PROSODY_VOLUME_TYPE_NUMERIC,
93  PROSODY_VOLUME_TYPE_RELATIVE_CHANGE,
94 
95  PROSODY_VOLUME_TYPE_UNKNOWN
97 
98 /** Prosody-rate type */
99 typedef enum {
100  PROSODY_RATE_TYPE_LABEL,
101  PROSODY_RATE_TYPE_RELATIVE_CHANGE,
102 
103  PROSODY_RATE_TYPE_UNKNOWN
105 
106 /** Prosody-volume */
107 typedef enum {
108  PROSODY_VOLUME_SILENT,
109  PROSODY_VOLUME_XSOFT,
110  PROSODY_VOLUME_SOFT,
111  PROSODY_VOLUME_MEDIUM,
112  PROSODY_VOLUME_LOUD,
113  PROSODY_VOLUME_XLOUD,
114  PROSODY_VOLUME_DEFAULT,
115 
116  PROSODY_VOLUME_COUNT,
117  PROSODY_VOLUME_UNKNOWN = PROSODY_VOLUME_COUNT
119 
120 /** Prosody-rate */
121 typedef enum {
122  PROSODY_RATE_XSLOW,
123  PROSODY_RATE_SLOW,
124  PROSODY_RATE_MEDIUM,
125  PROSODY_RATE_FAST,
126  PROSODY_RATE_XFAST,
127  PROSODY_RATE_DEFAULT,
128 
129  PROSODY_RATE_COUNT,
130  PROSODY_RATE_UNKNOWN = PROSODY_RATE_COUNT
132 
133 /** Synthesizer completion-cause specified in SPEAK-COMPLETE event */
134 typedef enum {
135  SYNTHESIZER_COMPLETION_CAUSE_NORMAL = 0,
136  SYNTHESIZER_COMPLETION_CAUSE_BARGE_IN = 1,
137  SYNTHESIZER_COMPLETION_CAUSE_PARSE_FAILURE = 2,
138  SYNTHESIZER_COMPLETION_CAUSE_URI_FAILURE = 3,
139  SYNTHESIZER_COMPLETION_CAUSE_ERROR = 4,
140  SYNTHESIZER_COMPLETION_CAUSE_LANGUAGE_UNSUPPORTED = 5,
141  SYNTHESIZER_COMPLETION_CAUSE_LEXICON_LOAD_FAILURE = 6,
142  SYNTHESIZER_COMPLETION_CAUSE_CANCELLED = 7,
143 
144  SYNTHESIZER_COMPLETION_CAUSE_COUNT = 8,
145  SYNTHESIZER_COMPLETION_CAUSE_UNKNOWN = SYNTHESIZER_COMPLETION_CAUSE_COUNT
147 
148 
149 /** Speech-length value declaration */
151 /** Numeric speech-length declaration */
153 /** Prosody-param declaration */
155 /** Voice-param declaration */
157 /**Prosody-rate declaration*/
159 /**Prosody-volume declaration*/
161 /** MRCP synthesizer-header declaration */
163 
164 /** Numeric speech-length */
166  /** The length */
167  apr_size_t length;
168  /** The unit (second/word/sentence/paragraph) */
170 };
171 
172 /** Definition of speech-length value */
174  /** Speech-length type (numeric/text)*/
176  /** Speech-length value (either numeric or text) */
177  union {
178  /** Text speech-length */
180  /** Numeric speech-length */
182  } value;
183 };
184 
185 /** MRCP voice-param */
187  /** Voice gender (male/femaile/neutral)*/
189  /** Voice age */
190  apr_size_t age;
191  /** Voice variant */
192  apr_size_t variant;
193  /** Voice name */
195 };
196 
197 /** MRCP prosody-volume */
199  /** prosody-volume type (one of label,numeric,relative change) */
201 
202  /** prosody-volume value */
203  union {
204  /** one of "silent", "x-soft", ... */
206  /** numeric value */
207  float numeric;
208  /** relative change */
209  float relative;
210  } value;
211 };
212 
213 /** MRCP prosody-rate */
215  /** prosody-rate type (one of label, relative change) */
217 
218  /** prosody-rate value */
219  union {
220  /** one of "x-slow", "slow", ... */
222  /** relative change */
223  float relative;
224  } value;
225 };
226 
227 /** MRCP prosody-param */
229  /** Prosofy volume */
231  /** Prosofy rate */
233 };
234 
235 /** MRCP synthesizer-header */
237  /** MAY be specified in a CONTROL method and controls the
238  amount to jump forward or backward in an active "SPEAK" request */
240  /** MAY be sent as part of the "SPEAK" method to enable kill-
241  on-barge-in support */
243  /** MAY be part of the "SET-PARAMS"/"GET-PARAMS" or "SPEAK"
244  request from the client to the server and specifies a URI which
245  references the profile of the speaker */
247  /** MUST be specified in a "SPEAK-COMPLETE" event coming from
248  the synthesizer resource to the client */
250  /** MAY be specified in a "SPEAK-COMPLETE" event coming from
251  the synthesizer resource to the client */
253  /** This set of header fields defines the voice of the speaker */
255  /** This set of header fields defines the prosody of the speech */
257  /** Contains timestamp information in a "timestamp" field */
259  /** specifies the default language of the speech data if the
260  language is not specified in the markup */
262  /** When the synthesizer needs to fetch documents or other resources like
263  speech markup or audio files, this header controls the corresponding
264  URI access properties */
266  /** When the synthesizer needs to fetch documents or other resources like
267  speech audio files, this header controls the corresponding URI access
268  properties */
270  /** When a synthesizer method needs a synthesizer to fetch or access a
271  URI and the access fails, the server SHOULD provide the failed URI in
272  this header in the method response */
274  /** When a synthesizer method needs a synthesizer to fetch or access a
275  URI and the access fails the server MUST provide the URI specific or
276  protocol specific response code for the URI in the Failed-URI header
277  in the method response through this header */
279  /** When a CONTROL request to jump backward is issued to a currently
280  speaking synthesizer resource, and the target jump point is before
281  the start of the current "SPEAK" request, the current "SPEAK" request
282  MUST restart */
284  /** MAY be specified in a CONTROL method to control the
285  length of speech to speak, relative to the current speaking point in
286  the currently active "SPEAK" request */
288  /** Used to indicate whether a lexicon has to be loaded or unloaded */
290  /** Used to specify a list of active Lexicon URIs and the
291  search order among the active lexicons */
293 };
294 
295 /** Get synthesizer header vtable */
297 
298 /** Get synthesizer completion cause string */
300 
301 
303 
304 #endif /* MRCP_SYNTH_HEADER_H */