Skip to main content
Skip table of contents

WebSocket API ‎

Voice Recognition

ROUTE Recognize

CODE
/v1/voice-recognition/recognize

Messages

SEND Audio Chunk Message
JSON
{
  "data": "data:audio/pcm;base64,<base64_audio>",
  "last": <bool>
}
RECEIVE Result Message
JSON
{
  "result": {
    "type": 0,
    "type_string": "ASR",
    "is_final": <bool>,
    "begin_time": <int>,
    "end_time": <int>,
    "hypotheses": [ <hypothesis>, ... ]
  }
}
DETAILS Result Hypothesis
JSON
  "hypotheses": [
    {
      "confidence": <int>,
      "begin_time": <int>,
      "end_time": <int>,
      "start_rule": <string>,
      "items": [ <item>, ... ]
    },
    ...
  ]
DETAILS Result Item (Orthography)
JSON
  "items": [
    {
      "confidence": <int>,
      "begin_time": <int>,
      "end_time": <int>,
      "type": "terminal",
      "orthography": <string>
    },
    ...
  ]
DETAILS Result Item (Tag)
JSON
  "items": [
    {
      "confidence": <int>,
      "begin_time": <int>,
      "end_time": <int>,
      "type": "tag",
      "name": <string>,
      "items": [ <item>, ... ]
    },
    ...
  ]
RECEIVE Event Message
JSON
{
  "event": {
    "code": <int>
    "code_string": <string>,
    "message": <string>,
    "timestamp": <int>
  }
}
RECEIVE Error Message
JSON
{
  "error": {
    "type": <string>,
    "code": <int>,
    "code_string": <string>,
    "message": <string>
  }
}

Voice Synthesis

ROUTE Synthesize

CODE
/v1/voice-synthesis/synthesize

Messages

RECEIVE Audio Chunk Message

JSON
{
  "data": "data:audio/pcm;base64,<base64_audio>",
  "last": <bool>
}

RECEIVE Event Message

JSON
{
  "event": {
    "code": <int>
    "code_string": <string>,
    "message": <string>,
    "timestamp": <int>
  }
}

RECEIVE Error Message

JSON
{
  "error": {
    "type": <string>,
    "code": <int>,
    "code_string": <string>,
    "message": <string>
  }
}

Voice Biometrics

ROUTE Authenticate

CODE
/v1/voice-biometrics/authenticate

Messages

SEND Audio Chunk Message

JSON
{
  "data": "data:audio/pcm;base64,<base64_audio>",
  "last": <bool>
}

RECEIVE Result Message

JSON
{
  "id": <string>,
  "probability": <double>,
  "score": <double>
}

RECEIVE Event Message

JSON
{
  "event": {
    "code": <int>
    "code_string": <string>,
    "message": <string>,
    "timestamp": <int>
  }
}

RECEIVE Error Message

JSON
{
  "error": {
    "type": <string>,
    "code": <int>,
    "code_string": <string>,
    "message": <string>
  }
}

ROUTE Identify

CODE
/v1/voice-biometrics/identify

Messages

SEND Audio Chunk Message

JSON
{
  "data": "data:audio/pcm;base64,<base64_audio>",
  "last": <bool>
} 

RECEIVE Result Message

JSON
{
  "id": <string>,
  "probability": <double>,
  "type": <string>
}

RECEIVE Event Message

JSON
{
  "event": {
    "code": <int>
    "code_string": <string>,
    "message": <string>,
    "timestamp": <int>
  }
}

RECEIVE Error Message

JSON
{
  "error": {
    "type": <string>,
    "code": <int>,
    "code_string": <string>,
    "message": <string>
  }
}

ROUTE Enroll

CODE
/v1/voice-biometrics/enroll

Messages

SEND Audio Chunk Message

JSON
{
  "data": "data:audio/pcm;base64,<base64_audio>",
  "last": <bool>
} 

RECEIVE Result Message

JSON
{
  "accepted": <bool>,
  "progress": <int>,
  "speech_duration": <double>,
  "utterances": [ <utterance>, ... ]
}

RECEIVE Event Message

JSON
{
  "event": {
    "code": <int>
    "code_string": <string>,
    "message": <string>,
    "timestamp": <int>
  }
}

RECEIVE Error Message

JSON
{
  "error": {
    "type": <string>,
    "code": <int>,
    "code_string": <string>,
    "message": <string>
  }
}

RECEIVE Info Message

JSON
{
  "message": <string>,
  "type": <string>
} 
DETAILS Result utterance
JSON
"utterances": [
    {
      "accepted": <bool>,
      "contains_speech": <bool>,
      "enough_speech": <bool>,
      "is_band_limited": <bool>,
      "is_consistent": <bool>,
      "is_peak_clipped": <bool>,
      "is_snr_ok": <bool>,
      "snr": <double>,
      "speech_duration": <double>
    },
    ...
  ]

Speech Enhancement

ROUTE Enhance

CODE
/v1/speech-enhancement/enhance

Messages

SEND Audio Chunk Message

JSON
{
  "data": "data:audio/pcm;base64,<base64_audio>",
  "last": <bool>
} 

RECEIVE Audio Chunk Message

JSON
{
  "data": "data:audio/pcm;base64,<base64_audio>",
  "last": <bool>
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.