UniMRCP  1.3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mrcp_recorder_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_recorder_header.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17  */
18 
19 #ifndef MRCP_RECORDER_HEADER_H
20 #define MRCP_RECORDER_HEADER_H
21 
22 /**
23  * @file mrcp_recorder_header.h
24  * @brief MRCP Recorder Header
25  */
26 
27 #include "mrcp_types.h"
28 #include "mrcp_header_accessor.h"
29 
31 
32 /** MRCP recorder header fields */
33 typedef enum {
34  RECORDER_HEADER_SENSITIVITY_LEVEL,
35  RECORDER_HEADER_NO_INPUT_TIMEOUT,
36  RECORDER_HEADER_COMPLETION_CAUSE,
37  RECORDER_HEADER_COMPLETION_REASON,
38  RECORDER_HEADER_FAILED_URI,
39  RECORDER_HEADER_FAILED_URI_CAUSE,
40  RECORDER_HEADER_RECORD_URI,
41  RECORDER_HEADER_MEDIA_TYPE,
42  RECORDER_HEADER_MAX_TIME,
43  RECORDER_HEADER_TRIM_LENGTH,
44  RECORDER_HEADER_FINAL_SILENCE,
45  RECORDER_HEADER_CAPTURE_ON_SPEECH,
46  RECORDER_HEADER_VER_BUFFER_UTTERANCE,
47  RECORDER_HEADER_START_INPUT_TIMERS,
48  RECORDER_HEADER_NEW_AUDIO_CHANNEL,
49 
50  RECORDER_HEADER_COUNT
52 
53 
54 /** MRCP recorder completion-cause */
55 typedef enum {
56  RECORDER_COMPLETION_CAUSE_SUCCESS_SILENCE = 0,
57  RECORDER_COMPLETION_CAUSE_SUCCESS_MAXTIME = 1,
58  RECORDER_COMPLETION_CAUSE_NO_INPUT_TIMEOUT = 2,
59  RECORDER_COMPLETION_CAUSE_URI_FAILURE = 3,
60  RECORDER_COMPLETION_CAUSE_ERROR = 4,
61 
62  RECORDER_COMPLETION_CAUSE_COUNT = 5,
63  RECORDER_COMPLETION_CAUSE_UNKNOWN = RECORDER_COMPLETION_CAUSE_COUNT
65 
66 
67 
68 /** MRCP recorder-header declaration */
70 
71 /** MRCP recorder-header */
73  /** To filter out background noise and not mistake it for speech */
75  /** When recording is started and there is no speech detected for a
76  certain period of time, the recorder can send a RECORD-COMPLETE event */
77  apr_size_t no_input_timeout;
78  /** MUST be part of a RECORD-COMPLETE event coming from the
79  recorder resource to the client */
81  /** MAY be specified in a RECORD-COMPLETE event coming from
82  the recorder resource to the client */
84  /** When a recorder method needs to post the audio to a URI and access to
85  the URI fails, the server MUST provide the failed URI in this header
86  in the method response */
88  /** When a recorder method needs to post the audio to a URI and access to
89  the URI fails, the server MUST provide the URI specific or protocol
90  specific response code through this header in the method response */
92  /** When a recorder method contains this header the server must capture
93  the audio and store it */
95  /** A RECORD method MUST contain this header, which specifies to the
96  server the Media Type of the captured audio or video */
98  /** When recording is started this specifies the maximum length of the
99  recording in milliseconds, calculated from the time the actual
100  capture and store begins and is not necessarily the time the RECORD
101  method is received */
102  apr_size_t max_time;
103  /** This header MAY be sent on a STOP method and specifies the length of
104  audio to be trimmed from the end of the recording after the stop */
105  apr_size_t trim_length;
106  /** When recorder is started and the actual capture begins, this header
107  specifies the length of silence in the audio that is to be
108  interpreted as the end of the recording*/
109  apr_size_t final_silence;
110  /** f false, the recorder MUST start capturing immediately when started.
111  If true, the recorder MUST wait for the endpointing functionality to
112  detect speech before it starts capturing */
114  /** Tells the server to buffer the utterance associated with this
115  recording request into the verification buffer */
117  /** MAY be sent as part of the RECORD request. A value of false tells the
118  recorder resource to start the operation, but not to start the no-input
119  timer until the client sends a START-INPUT-TIMERS */
121  /** MAY be specified in a RECORD request and allows the
122  client to tell the server that, from this point on, further input
123  audio comes from a different audio source */
125 };
126 
127 
128 /** Get recorder header vtable */
130 
131 /** Get recorder completion cause string */
133  mrcp_recorder_completion_cause_e completion_cause,
134  mrcp_version_e version);
135 
137 
138 #endif /* MRCP_RECORDER_HEADER_H */