Skip to content

Instantly share code, notes, and snippets.

@apla
Created January 15, 2016 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apla/c20edbf071e13b3cf93d to your computer and use it in GitHub Desktop.
Save apla/c20edbf071e13b3cf93d to your computer and use it in GitHub Desktop.
protocol-buffers error
package BasicProtobuf;
message ConnectionResponse
{
required ResponseCode responseCode = 1;
required string sessionId = 2;
optional string message = 3;
enum ResponseCode {
OK = 200;
BadMessageFormatting = 400;
UnknownService = 404;
NotSupportedVersion = 405;
Timeout = 408;
ProtocolError = 410;
InternalError = 500;
}
}
Error: Could not resolve VoiceProxyProtobuf.AlignInfo
at resolve (/Users/apla/work/rian/speech/node_modules/protocol-buffers/compile.js:502:19)
at /Users/apla/work/rian/speech/node_modules/protocol-buffers/compile.js:185:14
at Array.map (native)
at compileMessage (/Users/apla/work/rian/speech/node_modules/protocol-buffers/compile.js:184:24)
at resolve (/Users/apla/work/rian/speech/node_modules/protocol-buffers/compile.js:505:27)
at /Users/apla/work/rian/speech/node_modules/protocol-buffers/compile.js:509:12
at Array.map (native)
at module.exports (/Users/apla/work/rian/speech/node_modules/protocol-buffers/compile.js:508:62)
at new Messages (/Users/apla/work/rian/speech/node_modules/protocol-buffers/index.js:14:5)
at module.exports (/Users/apla/work/rian/speech/node_modules/protocol-buffers/index.js:27:10)
import "basic.proto";
package VoiceProxyProtobuf;
message MusicRequest
{
message MusicParam
{
required string name = 1;
required string value = 2;
}
// default options are "uid", "OAuth", "widget"
repeated MusicParam musicProxyOptions = 1;
}
message AdvancedASROptions
{
optional bool partial_results = 1 [default = true];
optional float beam = 2 [default = -1];
optional float lattice_beam = 3 [default = -1];
optional int32 lattice_nbest = 4 [default = -1];
optional int32 utterance_silence = 5 [default = 120];
optional bool allow_multi_utt = 16 [default = true];
optional int32 chunk_process_limit = 17 [default = 100];
optional int32 cmn_window = 18 [default = 600];
optional int32 cmn_latency = 19 [default = 150];
}
message ConnectionRequest
{
optional int32 protocolVersion = 1 [default = 1];
// leave empty if you are not speechkit
required string speechkitVersion = 2;
required string serviceName = 3; // "asr_dictation", etc.
required string uuid = 4;
required string apiKey = 5;
required string applicationName = 6;
// vendor:model:type... user defined
required string device = 7;
// lat.lat,lan.lan
required string coords = 8;
// "general", "mapsyari", "freeform", "music"
required string topic = 9;
// "ru-RU"
required string lang = 10;
// "audio/x-speex", "audio/x-pcm;bit=16;rate=8000", etc.
required string format =11;
// enable punctuation mode for "freeform-dictation" topic
optional bool punctuation = 12 [default = true];
// data will also be send to music proxy, and optional AddDataResponse may happend with musicProxyResponse
optional MusicRequest musicRequest = 17;
optional bool disableAntimatNormalizer = 18 [default = false];
optional AdvancedASROptions advancedASROptions = 19;
optional bool skipAudioFromLogging = 20 [default = false];
}
///////////////////////////////////////////////////////////////////////////
message AddData
{
optional bytes audioData = 1;
required bool lastChunk = 2;
}
///////////////////////////////////////////////////////////////////////////
message AlignInfo
{
optional float start_time = 1;
optional float end_time = 2;
optional float acoustic_score = 3;
optional float graph_score = 4;
optional float lm_score = 5;
optional float total_score = 6;
}
message Word
{
required float confidence = 1;
required string value = 2;
optional VoiceProxyProtobuf.AlignInfo align_info = 3;
}
message Result
{
required float confidence = 1;
repeated Word words = 2;
optional string normalized = 3;
optional VoiceProxyProtobuf.AlignInfo align_info = 4;
}
message AddDataResponse
{
required BasicProtobuf.ConnectionResponse.ResponseCode responseCode = 1;
repeated Result recognition = 2;
// if true : recognition contains fully parsed N-best list (n results with n words)
// otherwise recognition contains just 1 result 1 word with current "partical result"
optional bool endOfUtt = 3 [default = false];
// how many AddData requests were merged for this response
optional int32 messagesCount = 4 [default = 1];
// if not empty messageCounter should be 0
optional string musicProxyResponse = 5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment