Demo entry 6634083

测试一个

   

Submitted by anonymous on Aug 09, 2017 at 05:29
Language: Java. Code size: 1.7 kB.

/**
 * ASR reqest and response proto
 */
option java_package = "com.bj58.dia.asr.common.proto";
option java_outer_classname = "AsrProtos";
option java_generic_services = true;
option java_generate_equals_and_hash = true;
package asr.common;

enum AudioType{
  AMR = 1;
  WAV = 2;
}

enum Operator{
	RECOGNIZE = 1; //识别
	RECOGNIZE_WITH_KEYWORD = 2; //带关键词的识别
	KEYWORD = 3;  //识别+关键词提取
}

message UrlBaseRequest{
  required string url = 1;
  required AudioType audioType = 2;
  required Operator operator = 3;
  optional int32 keywordSourceId = 4 [default = -1];
  optional int32 descriptionMataId = 5 [default = -1];
  optional string description = 6;
}
message AudioSplitOption{
  required int32 start = 1;
  required int32 duration = 2;
}
message WmbRequest{
  required UrlBaseRequest baseRequest = 1;
  optional AudioSplitOption splitOption = 2;
  required string sourceId = 3;
  required uint64 id =4;
}
message ScfRequest{
  required UrlBaseRequest baseRequest = 1;
  optional AudioSplitOption splitOption = 2;
}

enum ResponseCode{
  SUCCESS = 0;
  INVALID_REQUEST = 1;
  INVALID_URL_ERROR = 2;
  DOWNLOAD_ERROR = 3;
  DOWNLOAD_TIMEOUT_ERROR = 4;
  AUDIO_FILE_BAD_ERROR = 5; //eg. too large,empty,too small
  AUDIO_FORMAT_ERROR = 6;
  INTERNAL_ERROR = 7;
  UNKNOW_ERROR = 8;
}

message UrlBaseResponse{
  required ResponseCode responseCode = 1;
  optional string error_msg = 2;
  optional string result = 3;
  repeated string keywords = 4;
}
message WmbResponse{
  required UrlBaseResponse baseResponse = 1;
  required string sourceId = 2;
  required uint64 id =3;
}
message ScfResponse{
  required UrlBaseResponse baseResponse = 1;
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).