UniMRCP  1.7.0
mrcp_synth_header.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2015 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 
17 #ifndef MRCP_SYNTH_HEADER_H
18 #define MRCP_SYNTH_HEADER_H
19 
20 /**
21  * @file mrcp_synth_header.h
22  * @brief MRCP Synthesizer Header
23  */
24 
25 #include "mrcp_types.h"
26 #include "mrcp_header_accessor.h"
27 
29 
30 /** MRCP synthesizer header fields */
31 typedef enum {
32  SYNTHESIZER_HEADER_JUMP_SIZE,
33  SYNTHESIZER_HEADER_KILL_ON_BARGE_IN,
34  SYNTHESIZER_HEADER_SPEAKER_PROFILE,
35  SYNTHESIZER_HEADER_COMPLETION_CAUSE,
36  SYNTHESIZER_HEADER_COMPLETION_REASON,
37  SYNTHESIZER_HEADER_VOICE_GENDER,
38  SYNTHESIZER_HEADER_VOICE_AGE,
39  SYNTHESIZER_HEADER_VOICE_VARIANT,
40  SYNTHESIZER_HEADER_VOICE_NAME,
41  SYNTHESIZER_HEADER_PROSODY_VOLUME,
42  SYNTHESIZER_HEADER_PROSODY_RATE,
43  SYNTHESIZER_HEADER_SPEECH_MARKER,
44  SYNTHESIZER_HEADER_SPEECH_LANGUAGE,
45  SYNTHESIZER_HEADER_FETCH_HINT,
46  SYNTHESIZER_HEADER_AUDIO_FETCH_HINT,
47  SYNTHESIZER_HEADER_FAILED_URI,
48  SYNTHESIZER_HEADER_FAILED_URI_CAUSE,
49  SYNTHESIZER_HEADER_SPEAK_RESTART,
50  SYNTHESIZER_HEADER_SPEAK_LENGTH,
51  SYNTHESIZER_HEADER_LOAD_LEXICON,
52  SYNTHESIZER_HEADER_LEXICON_SEARCH_ORDER,
53 
54  SYNTHESIZER_HEADER_COUNT
56 
57 
58 /** Speech-units */
59 typedef enum {
60  SPEECH_UNIT_SECOND,
61  SPEECH_UNIT_WORD,
62  SPEECH_UNIT_SENTENCE,
63  SPEECH_UNIT_PARAGRAPH,
64 
65  SPEECH_UNIT_COUNT
67 
68 /** Speech-length types */
69 typedef enum {
70  SPEECH_LENGTH_TYPE_TEXT,
71  SPEECH_LENGTH_TYPE_NUMERIC_POSITIVE,
72  SPEECH_LENGTH_TYPE_NUMERIC_NEGATIVE,
73 
74  SPEECH_LENGTH_TYPE_UNKNOWN
76 
77 /** MRCP voice-gender */
78 typedef enum {
79  VOICE_GENDER_MALE,
80  VOICE_GENDER_FEMALE,
81  VOICE_GENDER_NEUTRAL,
82 
83  VOICE_GENDER_COUNT,
84  VOICE_GENDER_UNKNOWN = VOICE_GENDER_COUNT
86 
87 /** Prosody-volume type */
88 typedef enum {
89  PROSODY_VOLUME_TYPE_LABEL,
90  PROSODY_VOLUME_TYPE_NUMERIC,
91  PROSODY_VOLUME_TYPE_RELATIVE_CHANGE,
92 
93  PROSODY_VOLUME_TYPE_UNKNOWN
95 
96 /** Prosody-rate type */
97 typedef enum {
98  PROSODY_RATE_TYPE_LABEL,
99  PROSODY_RATE_TYPE_RELATIVE_CHANGE,
100 
101  PROSODY_RATE_TYPE_UNKNOWN
103 
104 /** Prosody-volume */
105 typedef enum {
106  PROSODY_VOLUME_SILENT,
107  PROSODY_VOLUME_XSOFT,
108  PROSODY_VOLUME_SOFT,
109  PROSODY_VOLUME_MEDIUM,
110  PROSODY_VOLUME_LOUD,
111  PROSODY_VOLUME_XLOUD,
112  PROSODY_VOLUME_DEFAULT,
113 
114  PROSODY_VOLUME_COUNT,
115  PROSODY_VOLUME_UNKNOWN = PROSODY_VOLUME_COUNT
117 
118 /** Prosody-rate */
119 typedef enum {
120  PROSODY_RATE_XSLOW,
121  PROSODY_RATE_SLOW,
122  PROSODY_RATE_MEDIUM,
123  PROSODY_RATE_FAST,
124  PROSODY_RATE_XFAST,
125  PROSODY_RATE_DEFAULT,
126 
127  PROSODY_RATE_COUNT,
128  PROSODY_RATE_UNKNOWN = PROSODY_RATE_COUNT
130 
131 /** Synthesizer completion-cause specified in SPEAK-COMPLETE event */
132 typedef enum {
133  SYNTHESIZER_COMPLETION_CAUSE_NORMAL = 0,
134  SYNTHESIZER_COMPLETION_CAUSE_BARGE_IN = 1,
135  SYNTHESIZER_COMPLETION_CAUSE_PARSE_FAILURE = 2,
136  SYNTHESIZER_COMPLETION_CAUSE_URI_FAILURE = 3,
137  SYNTHESIZER_COMPLETION_CAUSE_ERROR = 4,
138  SYNTHESIZER_COMPLETION_CAUSE_LANGUAGE_UNSUPPORTED = 5,
139  SYNTHESIZER_COMPLETION_CAUSE_LEXICON_LOAD_FAILURE = 6,
140  SYNTHESIZER_COMPLETION_CAUSE_CANCELLED = 7,
141 
142  SYNTHESIZER_COMPLETION_CAUSE_COUNT = 8,
143  SYNTHESIZER_COMPLETION_CAUSE_UNKNOWN = SYNTHESIZER_COMPLETION_CAUSE_COUNT
145 
146 
147 /** Speech-length value declaration */
149 /** Numeric speech-length declaration */
151 /** Prosody-param declaration */
153 /** Voice-param declaration */
155 /**Prosody-rate declaration*/
157 /**Prosody-volume declaration*/
159 /** MRCP synthesizer-header declaration */
161 
162 /** Numeric speech-length */
164  /** The length */
165  apr_size_t length;
166  /** The unit (second/word/sentence/paragraph) */
168 };
169 
170 /** Definition of speech-length value */
172  /** Speech-length type (numeric/text)*/
174  /** Speech-length value (either numeric or text) */
175  union {
176  /** Text speech-length */
178  /** Numeric speech-length */
180  } value;
181 };
182 
183 /** MRCP voice-param */
185  /** Voice gender (male/femaile/neutral)*/
187  /** Voice age */
188  apr_size_t age;
189  /** Voice variant */
190  apr_size_t variant;
191  /** Voice name */
193 };
194 
195 /** MRCP prosody-volume */
197  /** prosody-volume type (one of label,numeric,relative change) */
199 
200  /** prosody-volume value */
201  union {
202  /** one of "silent", "x-soft", ... */
204  /** numeric value */
205  float numeric;
206  /** relative change */
207  float relative;
208  } value;
209 };
210 
211 /** MRCP prosody-rate */
213  /** prosody-rate type (one of label, relative change) */
215 
216  /** prosody-rate value */
217  union {
218  /** one of "x-slow", "slow", ... */
220  /** relative change */
221  float relative;
222  } value;
223 };
224 
225 /** MRCP prosody-param */
227  /** Prosofy volume */
229  /** Prosofy rate */
231 };
232 
233 /** MRCP synthesizer-header */
235  /** MAY be specified in a CONTROL method and controls the
236  amount to jump forward or backward in an active "SPEAK" request */
238  /** MAY be sent as part of the "SPEAK" method to enable kill-
239  on-barge-in support */
241  /** MAY be part of the "SET-PARAMS"/"GET-PARAMS" or "SPEAK"
242  request from the client to the server and specifies a URI which
243  references the profile of the speaker */
245  /** MUST be specified in a "SPEAK-COMPLETE" event coming from
246  the synthesizer resource to the client */
248  /** MAY be specified in a "SPEAK-COMPLETE" event coming from
249  the synthesizer resource to the client */
251  /** This set of header fields defines the voice of the speaker */
253  /** This set of header fields defines the prosody of the speech */
255  /** Contains timestamp information in a "timestamp" field */
257  /** specifies the default language of the speech data if the
258  language is not specified in the markup */
260  /** When the synthesizer needs to fetch documents or other resources like
261  speech markup or audio files, this header controls the corresponding
262  URI access properties */
264  /** When the synthesizer needs to fetch documents or other resources like
265  speech audio files, this header controls the corresponding URI access
266  properties */
268  /** When a synthesizer method needs a synthesizer to fetch or access a
269  URI and the access fails, the server SHOULD provide the failed URI in
270  this header in the method response */
272  /** When a synthesizer method needs a synthesizer to fetch or access a
273  URI and the access fails the server MUST provide the URI specific or
274  protocol specific response code for the URI in the Failed-URI header
275  in the method response through this header */
277  /** When a CONTROL request to jump backward is issued to a currently
278  speaking synthesizer resource, and the target jump point is before
279  the start of the current "SPEAK" request, the current "SPEAK" request
280  MUST restart */
282  /** MAY be specified in a CONTROL method to control the
283  length of speech to speak, relative to the current speaking point in
284  the currently active "SPEAK" request */
286  /** Used to indicate whether a lexicon has to be loaded or unloaded */
288  /** Used to specify a list of active Lexicon URIs and the
289  search order among the active lexicons */
291 };
292 
293 /** Get synthesizer header vtable */
295 
296 /** Get synthesizer completion cause string */
298 
299 
301 
302 #endif /* MRCP_SYNTH_HEADER_H */
mrcp_speech_unit_e unit
Definition: mrcp_synth_header.h:167
#define MRCP_DECLARE(type)
Definition: mrcp.h:40
mrcp_synthesizer_header_id
Definition: mrcp_synth_header.h:31
apt_str_t name
Definition: mrcp_synth_header.h:192
mrcp_speech_length_value_t speak_length
Definition: mrcp_synth_header.h:285
apt_str_t speaker_profile
Definition: mrcp_synth_header.h:244
float numeric
Definition: mrcp_synth_header.h:205
Definition: mrcp_synth_header.h:171
mrcp_prosody_rate_t rate
Definition: mrcp_synth_header.h:230
mrcp_prosody_volume_type_e
Definition: mrcp_synth_header.h:88
float relative
Definition: mrcp_synth_header.h:207
apt_str_t audio_fetch_hint
Definition: mrcp_synth_header.h:267
apr_size_t length
Definition: mrcp_synth_header.h:165
apt_str_t speech_language
Definition: mrcp_synth_header.h:259
Definition: mrcp_synth_header.h:234
#define APT_END_EXTERN_C
Definition: apt.h:38
mrcp_voice_gender_e gender
Definition: mrcp_synth_header.h:186
int apt_bool_t
Definition: apt.h:57
Definition: mrcp_header_accessor.h:37
mrcp_prosody_rate_type_e type
Definition: mrcp_synth_header.h:214
mrcp_version_e
Definition: mrcp_types.h:30
mrcp_prosody_rate_type_e
Definition: mrcp_synth_header.h:97
apt_str_t failed_uri
Definition: mrcp_synth_header.h:271
apt_str_t completion_reason
Definition: mrcp_synth_header.h:250
const mrcp_header_vtable_t * mrcp_synth_header_vtable_get(mrcp_version_e version)
apt_str_t lexicon_search_order
Definition: mrcp_synth_header.h:290
mrcp_speech_length_type_e type
Definition: mrcp_synth_header.h:173
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
mrcp_prosody_volume_label_e label
Definition: mrcp_synth_header.h:203
apr_size_t variant
Definition: mrcp_synth_header.h:190
Basic MRCP Types.
Definition: mrcp_synth_header.h:184
apt_str_t speech_marker
Definition: mrcp_synth_header.h:256
Definition: mrcp_synth_header.h:226
mrcp_prosody_param_t prosody_param
Definition: mrcp_synth_header.h:254
mrcp_prosody_volume_t volume
Definition: mrcp_synth_header.h:228
mrcp_synth_completion_cause_e completion_cause
Definition: mrcp_synth_header.h:247
apt_bool_t kill_on_barge_in
Definition: mrcp_synth_header.h:240
mrcp_voice_gender_e
Definition: mrcp_synth_header.h:78
apt_str_t fetch_hint
Definition: mrcp_synth_header.h:263
apt_str_t tag
Definition: mrcp_synth_header.h:177
mrcp_numeric_speech_length_t numeric
Definition: mrcp_synth_header.h:179
apt_str_t failed_uri_cause
Definition: mrcp_synth_header.h:276
apt_bool_t load_lexicon
Definition: mrcp_synth_header.h:287
float relative
Definition: mrcp_synth_header.h:221
const apt_str_t * mrcp_synth_completion_cause_get(mrcp_synth_completion_cause_e completion_cause, mrcp_version_e version)
Definition: apt_string.h:36
mrcp_voice_param_t voice_param
Definition: mrcp_synth_header.h:252
Definition: mrcp_synth_header.h:163
Definition: mrcp_synth_header.h:196
mrcp_prosody_rate_label_e
Definition: mrcp_synth_header.h:119
mrcp_synth_completion_cause_e
Definition: mrcp_synth_header.h:132
mrcp_speech_length_value_t jump_size
Definition: mrcp_synth_header.h:237
Definition: mrcp_synth_header.h:212
Abstract MRCP Header Accessor.
mrcp_prosody_volume_label_e
Definition: mrcp_synth_header.h:105
mrcp_prosody_rate_label_e label
Definition: mrcp_synth_header.h:219
mrcp_prosody_volume_type_e type
Definition: mrcp_synth_header.h:198
apt_bool_t speak_restart
Definition: mrcp_synth_header.h:281
apr_size_t age
Definition: mrcp_synth_header.h:188
mrcp_speech_length_type_e
Definition: mrcp_synth_header.h:69
mrcp_speech_unit_e
Definition: mrcp_synth_header.h:59