c@167: c@167: @0xc4b1c6c44c999206; c@167: c@167: using Cxx = import "/capnp/c++.capnp"; c@167: $Cxx.namespace("piper"); c@167: c@167: struct Basic { c@167: identifier @0 :Text; c@167: name @1 :Text; c@167: description @2 :Text; c@167: } c@167: c@167: struct ParameterDescriptor { c@167: basic @0 :Basic; c@167: unit @1 :Text; c@167: minValue @2 :Float32 = 0.0; c@167: maxValue @3 :Float32 = 0.0; c@167: defaultValue @4 :Float32 = 0.0; c@167: isQuantized @5 :Bool = false; c@167: quantizeStep @6 :Float32 = 0.0; c@167: valueNames @7 :List(Text) = []; c@167: } c@167: c@168: enum SampleType { c@168: oneSamplePerStep @0; c@168: fixedSampleRate @1; c@168: variableSampleRate @2; c@168: } c@168: c@167: struct ConfiguredOutputDescriptor { c@167: unit @0 :Text; c@167: hasFixedBinCount @1 :Bool = false; c@167: binCount @2 :Int32 = 0; c@167: binNames @3 :List(Text) = []; c@167: hasKnownExtents @4 :Bool = false; c@167: minValue @5 :Float32 = 0.0; c@167: maxValue @6 :Float32 = 0.0; c@167: isQuantized @7 :Bool = false; c@167: quantizeStep @8 :Float32 = 0.0; c@167: sampleType @9 :SampleType; c@167: sampleRate @10 :Float32 = 0.0; c@167: hasDuration @11 :Bool = false; c@167: } c@167: c@167: struct OutputDescriptor { c@167: basic @0 :Basic; c@167: configured @1 :ConfiguredOutputDescriptor; c@167: } c@167: c@168: enum InputDomain { c@168: timeDomain @0; c@168: frequencyDomain @1; c@168: } c@168: c@167: struct ExtractorStaticData { c@167: key @0 :Text; c@167: basic @1 :Basic; c@167: maker @2 :Text; c@167: copyright @3 :Text; c@167: version @4 :Int32; c@167: category @5 :List(Text); c@167: minChannelCount @6 :Int32; c@167: maxChannelCount @7 :Int32; c@167: parameters @8 :List(ParameterDescriptor); c@167: programs @9 :List(Text); c@167: inputDomain @10 :InputDomain; c@167: basicOutputInfo @11 :List(Basic); c@167: } c@167: c@168: struct RealTime { c@168: sec @0 :Int32 = 0; c@168: nsec @1 :Int32 = 0; c@168: } c@168: c@167: struct ProcessInput { c@167: inputBuffers @0 :List(List(Float32)); c@167: timestamp @1 :RealTime; c@167: } c@167: c@167: struct Feature { c@167: hasTimestamp @0 :Bool = false; c@167: timestamp @1 :RealTime; c@167: hasDuration @2 :Bool = false; c@167: duration @3 :RealTime; c@167: label @4 :Text; c@167: featureValues @5 :List(Float32) = []; c@167: } c@167: c@167: struct FeatureSet { c@167: struct FSPair { c@167: output @0 :Text; c@167: features @1 :List(Feature) = []; c@167: } c@167: featurePairs @0 :List(FSPair); c@167: } c@167: c@167: struct Configuration { c@167: struct PVPair { c@167: parameter @0 :Text; c@167: value @1 :Float32; c@167: } c@167: parameterValues @0 :List(PVPair); c@167: currentProgram @1 :Text; c@167: channelCount @2 :Int32; c@167: stepSize @3 :Int32; c@167: blockSize @4 :Int32; c@167: } c@167: c@168: enum AdapterFlag { c@168: adaptInputDomain @0; c@168: adaptChannelCount @1; c@168: adaptBufferSize @2; c@168: } c@168: c@168: const adaptAllSafe :List(AdapterFlag) = c@168: [ adaptInputDomain, adaptChannelCount ]; c@168: c@168: const adaptAll :List(AdapterFlag) = c@168: [ adaptInputDomain, adaptChannelCount, adaptBufferSize ]; c@168: c@167: struct ListRequest { c@167: } c@167: c@167: struct ListResponse { c@167: available @0 :List(ExtractorStaticData); c@167: } c@167: c@167: struct LoadRequest { c@167: key @0 :Text; c@167: inputSampleRate @1 :Float32; c@167: adapterFlags @2 :List(AdapterFlag); c@167: } c@167: c@167: struct LoadResponse { c@167: handle @0 :Int32; c@167: staticData @1 :ExtractorStaticData; c@167: defaultConfiguration @2 :Configuration; c@167: } c@167: c@167: struct ConfigurationRequest { c@167: handle @0 :Int32; c@167: configuration @1 :Configuration; c@167: } c@167: c@167: struct ConfigurationResponse { c@167: handle @0 :Int32; c@167: outputs @1 :List(OutputDescriptor); c@167: } c@167: c@167: struct ProcessRequest { c@167: handle @0 :Int32; c@167: processInput @1 :ProcessInput; c@167: } c@167: c@167: struct ProcessResponse { c@167: handle @0 :Int32; c@167: features @1 :FeatureSet; c@167: } c@167: c@167: struct FinishRequest { c@167: handle @0 :Int32; c@167: } c@167: c@167: struct FinishResponse { c@167: handle @0 :Int32; c@167: features @1 :FeatureSet; c@167: } c@167: c@167: struct Error { c@167: code @0 :Int32; c@167: message @1 :Text; c@167: } c@167: c@167: struct RpcRequest { c@167: # Request bundle for use when using Cap'n Proto serialisation without c@168: # Cap'n Proto RPC layer. For Cap'n Proto RPC, see piper.rpc.capnp. c@167: request :union { c@167: list @0 :ListRequest; c@167: load @1 :LoadRequest; c@167: configure @2 :ConfigurationRequest; c@167: process @3 :ProcessRequest; c@167: finish @4 :FinishRequest; # getRemainingFeatures and unload c@167: } c@167: } c@167: c@167: struct RpcResponse { c@167: # Response bundle for use when using Cap'n Proto serialisation without c@168: # Cap'n Proto RPC layer. For Cap'n Proto RPC, see piper.rpc.capnp. c@167: response :union { c@167: error @0 :Error; c@167: list @1 :ListResponse; c@167: load @2 :LoadResponse; c@167: configure @3 :ConfigurationResponse; c@167: process @4 :ProcessResponse; c@167: finish @5 :FinishResponse; c@167: } c@167: } c@167: