c@174
|
1
|
c@174
|
2 @0xc4b1c6c44c999206;
|
c@174
|
3
|
c@174
|
4 using Cxx = import "/capnp/c++.capnp";
|
c@174
|
5 $Cxx.namespace("piper");
|
c@174
|
6
|
c@174
|
7 struct Basic {
|
c@174
|
8 identifier @0 :Text;
|
c@174
|
9 name @1 :Text;
|
c@174
|
10 description @2 :Text;
|
c@174
|
11 }
|
c@174
|
12
|
c@174
|
13 struct ParameterDescriptor {
|
c@174
|
14 basic @0 :Basic;
|
c@174
|
15 unit @1 :Text;
|
c@174
|
16 minValue @2 :Float32 = 0.0;
|
c@174
|
17 maxValue @3 :Float32 = 0.0;
|
c@174
|
18 defaultValue @4 :Float32 = 0.0;
|
c@174
|
19 isQuantized @5 :Bool = false;
|
c@174
|
20 quantizeStep @6 :Float32 = 0.0;
|
c@174
|
21 valueNames @7 :List(Text) = [];
|
c@174
|
22 }
|
c@174
|
23
|
c@174
|
24 enum SampleType {
|
c@174
|
25 oneSamplePerStep @0;
|
c@174
|
26 fixedSampleRate @1;
|
c@174
|
27 variableSampleRate @2;
|
c@174
|
28 }
|
c@174
|
29
|
c@174
|
30 struct ConfiguredOutputDescriptor {
|
c@174
|
31 unit @0 :Text;
|
c@174
|
32 hasFixedBinCount @1 :Bool = false;
|
c@174
|
33 binCount @2 :Int32 = 0;
|
c@174
|
34 binNames @3 :List(Text) = [];
|
c@174
|
35 hasKnownExtents @4 :Bool = false;
|
c@174
|
36 minValue @5 :Float32 = 0.0;
|
c@174
|
37 maxValue @6 :Float32 = 0.0;
|
c@174
|
38 isQuantized @7 :Bool = false;
|
c@174
|
39 quantizeStep @8 :Float32 = 0.0;
|
c@174
|
40 sampleType @9 :SampleType;
|
c@174
|
41 sampleRate @10 :Float32 = 0.0;
|
c@174
|
42 hasDuration @11 :Bool = false;
|
c@174
|
43 }
|
c@174
|
44
|
c@174
|
45 struct OutputDescriptor {
|
c@174
|
46 basic @0 :Basic;
|
c@174
|
47 configured @1 :ConfiguredOutputDescriptor;
|
c@174
|
48 }
|
c@174
|
49
|
c@174
|
50 enum InputDomain {
|
c@174
|
51 timeDomain @0;
|
c@174
|
52 frequencyDomain @1;
|
c@174
|
53 }
|
c@174
|
54
|
c@174
|
55 struct ExtractorStaticData {
|
c@174
|
56 key @0 :Text;
|
c@174
|
57 basic @1 :Basic;
|
c@174
|
58 maker @2 :Text;
|
c@174
|
59 copyright @3 :Text;
|
c@174
|
60 version @4 :Int32;
|
c@174
|
61 category @5 :List(Text);
|
c@174
|
62 minChannelCount @6 :Int32;
|
c@174
|
63 maxChannelCount @7 :Int32;
|
c@174
|
64 parameters @8 :List(ParameterDescriptor);
|
c@174
|
65 programs @9 :List(Text);
|
c@174
|
66 inputDomain @10 :InputDomain;
|
c@174
|
67 basicOutputInfo @11 :List(Basic);
|
c@174
|
68 }
|
c@174
|
69
|
c@174
|
70 struct RealTime {
|
c@174
|
71 sec @0 :Int32 = 0;
|
c@174
|
72 nsec @1 :Int32 = 0;
|
c@174
|
73 }
|
c@174
|
74
|
c@174
|
75 struct ProcessInput {
|
c@174
|
76 inputBuffers @0 :List(List(Float32));
|
c@174
|
77 timestamp @1 :RealTime;
|
c@174
|
78 }
|
c@174
|
79
|
c@174
|
80 struct Feature {
|
c@174
|
81 hasTimestamp @0 :Bool = false;
|
c@174
|
82 timestamp @1 :RealTime;
|
c@174
|
83 hasDuration @2 :Bool = false;
|
c@174
|
84 duration @3 :RealTime;
|
c@174
|
85 label @4 :Text;
|
c@174
|
86 featureValues @5 :List(Float32) = [];
|
c@174
|
87 }
|
c@174
|
88
|
c@174
|
89 struct FeatureSet {
|
c@174
|
90 struct FSPair {
|
c@174
|
91 output @0 :Text;
|
c@174
|
92 features @1 :List(Feature) = [];
|
c@174
|
93 }
|
c@174
|
94 featurePairs @0 :List(FSPair);
|
c@174
|
95 }
|
c@174
|
96
|
c@174
|
97 struct Configuration {
|
c@174
|
98 struct PVPair {
|
c@174
|
99 parameter @0 :Text;
|
c@174
|
100 value @1 :Float32;
|
c@174
|
101 }
|
c@174
|
102 parameterValues @0 :List(PVPair);
|
c@174
|
103 currentProgram @1 :Text;
|
c@174
|
104 channelCount @2 :Int32;
|
c@174
|
105 stepSize @3 :Int32;
|
c@174
|
106 blockSize @4 :Int32;
|
c@174
|
107 }
|
c@174
|
108
|
c@174
|
109 enum AdapterFlag {
|
c@174
|
110 adaptInputDomain @0;
|
c@174
|
111 adaptChannelCount @1;
|
c@174
|
112 adaptBufferSize @2;
|
c@174
|
113 }
|
c@174
|
114
|
c@174
|
115 const adaptAllSafe :List(AdapterFlag) =
|
c@174
|
116 [ adaptInputDomain, adaptChannelCount ];
|
c@174
|
117
|
c@174
|
118 const adaptAll :List(AdapterFlag) =
|
c@174
|
119 [ adaptInputDomain, adaptChannelCount, adaptBufferSize ];
|
c@174
|
120
|
c@174
|
121 struct ListRequest {
|
c@179
|
122 from @0 :List(Text);
|
c@174
|
123 }
|
c@174
|
124
|
c@174
|
125 struct ListResponse {
|
c@174
|
126 available @0 :List(ExtractorStaticData);
|
c@174
|
127 }
|
c@174
|
128
|
c@174
|
129 struct LoadRequest {
|
c@174
|
130 key @0 :Text;
|
c@174
|
131 inputSampleRate @1 :Float32;
|
c@174
|
132 adapterFlags @2 :List(AdapterFlag);
|
c@174
|
133 }
|
c@174
|
134
|
c@174
|
135 struct LoadResponse {
|
c@174
|
136 handle @0 :Int32;
|
c@174
|
137 staticData @1 :ExtractorStaticData;
|
c@174
|
138 defaultConfiguration @2 :Configuration;
|
c@174
|
139 }
|
c@174
|
140
|
c@174
|
141 struct ConfigurationRequest {
|
c@174
|
142 handle @0 :Int32;
|
c@174
|
143 configuration @1 :Configuration;
|
c@174
|
144 }
|
c@174
|
145
|
c@174
|
146 struct ConfigurationResponse {
|
c@174
|
147 handle @0 :Int32;
|
c@174
|
148 outputs @1 :List(OutputDescriptor);
|
c@174
|
149 }
|
c@174
|
150
|
c@174
|
151 struct ProcessRequest {
|
c@174
|
152 handle @0 :Int32;
|
c@174
|
153 processInput @1 :ProcessInput;
|
c@174
|
154 }
|
c@174
|
155
|
c@174
|
156 struct ProcessResponse {
|
c@174
|
157 handle @0 :Int32;
|
c@174
|
158 features @1 :FeatureSet;
|
c@174
|
159 }
|
c@174
|
160
|
c@174
|
161 struct FinishRequest {
|
c@174
|
162 handle @0 :Int32;
|
c@174
|
163 }
|
c@174
|
164
|
c@174
|
165 struct FinishResponse {
|
c@174
|
166 handle @0 :Int32;
|
c@174
|
167 features @1 :FeatureSet;
|
c@174
|
168 }
|
c@174
|
169
|
c@174
|
170 struct Error {
|
c@174
|
171 code @0 :Int32;
|
c@174
|
172 message @1 :Text;
|
c@174
|
173 }
|
c@174
|
174
|
c@174
|
175 struct RpcRequest {
|
c@174
|
176 # Request bundle for use when using Cap'n Proto serialisation without
|
c@174
|
177 # Cap'n Proto RPC layer. For Cap'n Proto RPC, see piper.rpc.capnp.
|
c@175
|
178 id :union {
|
c@175
|
179 number @0 :Int32;
|
c@175
|
180 tag @1 :Text;
|
c@175
|
181 none @2 :Void;
|
c@175
|
182 }
|
c@174
|
183 request :union {
|
c@175
|
184 list @3 :ListRequest;
|
c@175
|
185 load @4 :LoadRequest;
|
c@175
|
186 configure @5 :ConfigurationRequest;
|
c@175
|
187 process @6 :ProcessRequest;
|
c@177
|
188 finish @7 :FinishRequest;
|
c@177
|
189 # finish gets any remaining calculated features and unloads
|
c@177
|
190 # the feature extractor. Note that you can call finish at any
|
c@177
|
191 # time -- even if you haven't configured or used the extractor,
|
c@177
|
192 # it will unload any resources used and abandon the handle.
|
c@174
|
193 }
|
c@174
|
194 }
|
c@174
|
195
|
c@174
|
196 struct RpcResponse {
|
c@174
|
197 # Response bundle for use when using Cap'n Proto serialisation without
|
c@174
|
198 # Cap'n Proto RPC layer. For Cap'n Proto RPC, see piper.rpc.capnp.
|
c@175
|
199 id :union {
|
c@175
|
200 number @0 :Int32;
|
c@175
|
201 tag @1 :Text;
|
c@175
|
202 none @2 :Void;
|
c@175
|
203 }
|
c@174
|
204 response :union {
|
c@175
|
205 error @3 :Error;
|
c@175
|
206 list @4 :ListResponse;
|
c@175
|
207 load @5 :LoadResponse;
|
c@175
|
208 configure @6 :ConfigurationResponse;
|
c@175
|
209 process @7 :ProcessResponse;
|
c@175
|
210 finish @8 :FinishResponse;
|
c@174
|
211 }
|
c@174
|
212 }
|
c@174
|
213
|