UniMRCP  1.7.0
mrcp_recorder_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_RECORDER_HEADER_H
18 #define MRCP_RECORDER_HEADER_H
19 
20 /**
21  * @file mrcp_recorder_header.h
22  * @brief MRCP Recorder Header
23  */
24 
25 #include "mrcp_types.h"
26 #include "mrcp_header_accessor.h"
27 
29 
30 /** MRCP recorder header fields */
31 typedef enum {
32  RECORDER_HEADER_SENSITIVITY_LEVEL,
33  RECORDER_HEADER_NO_INPUT_TIMEOUT,
34  RECORDER_HEADER_COMPLETION_CAUSE,
35  RECORDER_HEADER_COMPLETION_REASON,
36  RECORDER_HEADER_FAILED_URI,
37  RECORDER_HEADER_FAILED_URI_CAUSE,
38  RECORDER_HEADER_RECORD_URI,
39  RECORDER_HEADER_MEDIA_TYPE,
40  RECORDER_HEADER_MAX_TIME,
41  RECORDER_HEADER_TRIM_LENGTH,
42  RECORDER_HEADER_FINAL_SILENCE,
43  RECORDER_HEADER_CAPTURE_ON_SPEECH,
44  RECORDER_HEADER_VER_BUFFER_UTTERANCE,
45  RECORDER_HEADER_START_INPUT_TIMERS,
46  RECORDER_HEADER_NEW_AUDIO_CHANNEL,
47 
48  RECORDER_HEADER_COUNT
50 
51 
52 /** MRCP recorder completion-cause */
53 typedef enum {
54  RECORDER_COMPLETION_CAUSE_SUCCESS_SILENCE = 0,
55  RECORDER_COMPLETION_CAUSE_SUCCESS_MAXTIME = 1,
56  RECORDER_COMPLETION_CAUSE_NO_INPUT_TIMEOUT = 2,
57  RECORDER_COMPLETION_CAUSE_URI_FAILURE = 3,
58  RECORDER_COMPLETION_CAUSE_ERROR = 4,
59 
60  RECORDER_COMPLETION_CAUSE_COUNT = 5,
61  RECORDER_COMPLETION_CAUSE_UNKNOWN = RECORDER_COMPLETION_CAUSE_COUNT
63 
64 
65 
66 /** MRCP recorder-header declaration */
68 
69 /** MRCP recorder-header */
71  /** To filter out background noise and not mistake it for speech */
73  /** When recording is started and there is no speech detected for a
74  certain period of time, the recorder can send a RECORD-COMPLETE event */
75  apr_size_t no_input_timeout;
76  /** MUST be part of a RECORD-COMPLETE event coming from the
77  recorder resource to the client */
79  /** MAY be specified in a RECORD-COMPLETE event coming from
80  the recorder resource to the client */
82  /** When a recorder method needs to post the audio to a URI and access to
83  the URI fails, the server MUST provide the failed URI in this header
84  in the method response */
86  /** When a recorder method needs to post the audio to a URI and access to
87  the URI fails, the server MUST provide the URI specific or protocol
88  specific response code through this header in the method response */
90  /** When a recorder method contains this header the server must capture
91  the audio and store it */
93  /** A RECORD method MUST contain this header, which specifies to the
94  server the Media Type of the captured audio or video */
96  /** When recording is started this specifies the maximum length of the
97  recording in milliseconds, calculated from the time the actual
98  capture and store begins and is not necessarily the time the RECORD
99  method is received */
100  apr_size_t max_time;
101  /** This header MAY be sent on a STOP method and specifies the length of
102  audio to be trimmed from the end of the recording after the stop */
103  apr_size_t trim_length;
104  /** When recorder is started and the actual capture begins, this header
105  specifies the length of silence in the audio that is to be
106  interpreted as the end of the recording*/
107  apr_size_t final_silence;
108  /** f false, the recorder MUST start capturing immediately when started.
109  If true, the recorder MUST wait for the endpointing functionality to
110  detect speech before it starts capturing */
112  /** Tells the server to buffer the utterance associated with this
113  recording request into the verification buffer */
115  /** MAY be sent as part of the RECORD request. A value of false tells the
116  recorder resource to start the operation, but not to start the no-input
117  timer until the client sends a START-INPUT-TIMERS */
119  /** MAY be specified in a RECORD request and allows the
120  client to tell the server that, from this point on, further input
121  audio comes from a different audio source */
123 };
124 
125 
126 /** Get recorder header vtable */
128 
129 /** Get recorder completion cause string */
132  mrcp_version_e version);
133 
135 
136 #endif /* MRCP_RECORDER_HEADER_H */
#define MRCP_DECLARE(type)
Definition: mrcp.h:40
Definition: mrcp_recorder_header.h:70
apt_bool_t new_audio_channel
Definition: mrcp_recorder_header.h:122
apt_bool_t start_input_timers
Definition: mrcp_recorder_header.h:118
const mrcp_header_vtable_t * mrcp_recorder_header_vtable_get(mrcp_version_e version)
apt_bool_t ver_buffer_utterance
Definition: mrcp_recorder_header.h:114
#define APT_END_EXTERN_C
Definition: apt.h:38
mrcp_recorder_completion_cause_e completion_cause
Definition: mrcp_recorder_header.h:78
int apt_bool_t
Definition: apt.h:57
mrcp_recorder_header_id
Definition: mrcp_recorder_header.h:31
Definition: mrcp_header_accessor.h:37
apt_str_t media_type
Definition: mrcp_recorder_header.h:95
apt_str_t record_uri
Definition: mrcp_recorder_header.h:92
mrcp_version_e
Definition: mrcp_types.h:30
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
Basic MRCP Types.
apr_size_t final_silence
Definition: mrcp_recorder_header.h:107
apt_str_t failed_uri
Definition: mrcp_recorder_header.h:85
apt_str_t failed_uri_cause
Definition: mrcp_recorder_header.h:89
apr_size_t max_time
Definition: mrcp_recorder_header.h:100
Definition: apt_string.h:36
float sensitivity_level
Definition: mrcp_recorder_header.h:72
apt_str_t completion_reason
Definition: mrcp_recorder_header.h:81
mrcp_recorder_completion_cause_e
Definition: mrcp_recorder_header.h:53
const apt_str_t * mrcp_recorder_completion_cause_get(mrcp_recorder_completion_cause_e completion_cause, mrcp_version_e version)
Abstract MRCP Header Accessor.
apr_size_t no_input_timeout
Definition: mrcp_recorder_header.h:75
apt_bool_t capture_on_speech
Definition: mrcp_recorder_header.h:111
apr_size_t trim_length
Definition: mrcp_recorder_header.h:103