Notula Speech API

Welcome to Notula Speech API or so called nplatform which enables integration between Notula Speech Recognition Engine and developer applications. The API recognizes Bahasa Indonesia to support your needs. You can transcribe your voice seamlessly through either microphones or recorded voices with the latest state-of-the-art technology. Unleash broad possibility of ideas and enable command-and-control through voice.

Server

Authentication Server

https://oauth.bahasakita.co.id/api/token

Speech API Server

Development

https://api-dev.bahasakita.co.id/speech

Production

https://api.bahasakita.co.id/speech


Certificate (Curl Users)

Get certificate for Authentication and Speech API server. You can use openssl or get from browser

Authentication server

openssl s_client -showcerts -connect oauth.bahasakita.co.id:443 </dev/null 2>/dev/null|openssl x509 -outform PEM > oauth.bahasakita.co.id.pem

Speech API server

openssl s_client -showcerts -connect api.bahasakita.co.id:443 </dev/null 2>/dev/null|openssl x509 -outform PEM > api.bahasakita.co.id.pem

Client Credentials

You need client_credentials to get access_token that will be used to access Speech API server.

client_credentials is base64-encoded of your credential client_id:password
contact us to get client_id and password


Authentication

OAuth2

Once you get your client_id and password, you need to request access_token to our authentication service before accessing Speech API service. You can send POST request as follows :

Key Value
content_type application/x-www-form-urlencoded
Authorization Basic your_client_credentials

Note:
● The your_client_credentials is base64-encoded of your client credential (client_id:password)

Payload

Key Value
grant_type client_credentials
scope speech

Usages

Request Sample
curl -X POST 'https://oauth.bahasakita.co.id/api/token' -H "Content-type: application/x-www-form-urlencoded" -H "Authorization: Basic replace_with_your_client_credentials" -d 'grant_type=client_credentials' -d 'scope=speech' --cacert "oauth.bahasakita.co.id.pem"
Response Body Sample
{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjbGllbnRfaWQiOiJsYWxhbiIsImV4cGlyZXNfaW4iOjM2MDAsImlhdCI6MTU1MzU4OTAwOSwic2FsdCI6ImdWW1Z4Sl8vZyhjUmclbDciLCJzY29wZSI6InNwZWVjaCIsInR5cGUiOiJjbGllbnRfdG9rZW4ifQ.TMpZNSbR9ypk8oZ7TBjCpD3_TQuwNsx-qV_VOKNEapk","scope":"speech","token_type":"bearer","expires_in":3600}

Note:
● We will use the access_token element for next POST message


Transcription Operations

Mandatory Properties

Our Speech API requires some mandatory properties that needs to be provided in every request.

Key Child Key Grand Child Key Value
bk protocol stream
bk cmd cmd
bk entity your_entity_name
bk stan stan_uuid
bk time current_time
bk version 1.0
bk type type_message

Note:
cmd usage will be shown in the following sections
my_entity is your registered company name
stan_uuid is 37-character user generated ID and is regenerated for every request
current_time is UTC+7 current time
type_message is request = 0, response = 1, info = 2

Our response speech API will give you additionalcode property.

Key Child Key Grand Child Key Value
bk code int

Note:
● The code property only appears in response message, it contains success or error code (success = 0, other than are errors)


Initiate Stream

Initiating stream is intended to register a session of Notula Speech API service. You need to request POST comprised by header and payload as follows

Header

Key Value
content_type application/json
Accept-Charset UTF-8
Authorization Bearer access_token

Note:
access_token is obtained from OAuth2

Payload

Key Child Key Grand Child Key Value
bk protocol stream
bk cmd init
bk stan stan_uuid
bk entity your_entity_name
bk version 1.0
bk time current_time
bk type type_message
bk data session_id session_uuid
bk code code

Note:
● see mandatory properties
session_uuid is 37-character user generated ID

Usages:

curl -X POST 'https://api-dev.bahasakita.co.id/speech' -H "Content-type: application/json" -H "Authorization: Bearer replace_with_access_token -d '{"bk":{"protocol":"stream","data":{"session_id":"replace_with_session_uuid"},"stan":"replace_with_stan_uuid","cmd":"init","time":replace_with_current_time,"type":0,"version":"1.0","_your_entity_name_":"replace_with_your_entity_name"}}' --cacert "api.bahasakita.co.id.pem"

Request Body Sample

{"bk":{"protocol":"stream","data":{"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82"},"stan":"10c9dddc-c59a-4e9d-a449-110e34290bcb","cmd":"init","time":1553590202378,"type":0,"version":"1.0","entity":"resttest"}}

Response Body Sample

{"bk":{"protocol":"stream","code":0,"data":{"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82"},"stan":"10c9dddc-c59a-4e9d-a449-110e34290bcb","cmd":"init","time":1553590202361,"type":1,"version":"1.0","entity":"resttest"}}

Begin of Stream

After init request is responded with code : 0, you need to request begin of stream (bos) as a remark to keep engine steady to process audio stream.

Header

Key Value
content_type application/json
Accept-Charset UTF-8
Authorization Bearer access_token

Note:
access_token is obtained from OAuth2

Payload

Key Child Key Grand Child Key Value
bk protocol stream
bk cmd bos
bk entity your_entity_name
bk stan stan_uuid
bk time current_time
bk version 1.0
bk type type_message
bk data session_id session_id
bk code code

Note:
stan_uuid is regenerated
session_id is obtained session_id from init stream response
● see mandatory properties

Usages:

curl

curl -X POST 'https://api.bahasakita.co.id/speech' -H "Content-type: application/json" -H "Authorization: Bearer replace_with_access_token" -d '{"bk":{"protocol":"stream","data":{"replace_with_session_id":"replace_with_session_uuid"},"stan":"replace_with_stan_uuid","cmd":"bos","time":replace_with_current_time,"type":0,"version":"1.0","entity":"replace_with_your_entity_name"}}' --cacert "api.bahasakita.co.id.pem"

Request Body Sample

{"bk":{"protocol":"stream","data":{"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82"},"stan":"cb89e3c3-3702-448e-b0f9-3fd1d8bce7fb","cmd":"bos","time":1553590202433,"type":0,"version":"1.0","entity":"resttest"}}

Response Body Sample

{"bk":{"protocol":"stream","code":0,"data":{"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82","utterance_id":"24ebecba-4fa4-11e9-9954-acb57df86553"},"stan":"cb89e3c3-3702-448e-b0f9-3fd1d8bce7fb","cmd":"bos","time":1553590202411,"type":1,"version":"1.0","entity":"resttest"}}

Audio Streams

Everything is set and ready to stream the audio chunks. All Audio chunks must have to follow the format specified in Audio Format section. Note that transferring audio chunk is a synchronous process which means before next chunk can be sent, make sure previous chunk has finished and been responded with code : 0. If it were happened to retrieve code except 0, you needed to resend bos and continue audio chunk stream where it was malfunctioned.

Text data are delivered words by words, not sentences in a whole. These texts come along with the type, either partial or final. Type partial means the words are resulted directly from acoustic feature to most similar sounded word and not yet viewing the sentence level context. In other hand, type final means the words are resulted from language model decoding regarding the context. The partials then needs to be replaced by the final words. These type come alternately and do not have particular period of time, but whenever the machine feel it is enough to calculate the language model, it will do.

Header

Key Value
content_type application/json
Accept-Charset UTF-8
Authorization Bearer access_token

Note:
access_token is obtained from OAuth2

Payload

Key Child Key Grand Child Key Value
bk protocol stream
bk cmd audio
bk entity your_entity_name
bk stan stan_uuid
bk time current_time
bk version 1.0
bk type type_message
bk data session_id session_id
bk data offset offset
bk data len length
bk data audio audio
bk data utterance_id utterance_id
bk data next_utterance_id next_utterance_id
bk code code

Note:
stan_uuid is regenerated
session_id is obtained session_id from begin of stream response
offset is index of first index of the chunk element relative to audio first index
length is length of sent chunk
audio is base64 byte audio data
utterance_id is obtained utterance_id from begin of stream response for the first, second to N-th audio stream
next_utterance_id indicating a new utterance was created by the backend process
● see mandatory properties

Important!
next_utterance_id from audio response will be come utterance_id for the next audio stream request.

Usages:

curl

curl -X POST 'https://api.bahasakita.co.id/speech' -H "Content-type: application/json" -H "Authorization: Bearer replace_with_access_token" -d '{"bk": {"cmd": "audio", "entity": replace_with_your_entity_name", "stan": "replace_with_stan_uuid", "type": 0, "time": replace_with_current_time, "protocol": "stream", "version": "1.0", "data": {"session_id": "replace_with_session_uuid", "utterance_id": replace_with_bos_response_utterance_id_, "offset": offset, "len": length, "audio": audio}}}' --cacert "api.bahasakita.co.id.pem"

First Audio Chunk Request Body Sample

{"bk":{"protocol":"stream","data":{"offset":0,"len":3200,"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82","utterance_id":"24ebecba-4fa4-11e9-9954-acb57df86553","audio":"DwAbABkAGwAZAB8AFwAWABgAIAAJAPP\/+P\/z\/\/H\/8v\/z\/+7\/8\/\/v\/+L\/3v\/e\/+j\/4\/\/S\/8P\/wf\/c\/9r\/0v\/W\/+j\/BAAKAPP\/3\/\/j\/+b\/5v\/T\/8H\/wP\/O\/9j\/2f\/j\/+f\/5v\/o\/+D\/2f\/W\/9P\/zP\/D\/8j\/y\/\/K\/87\/1P\/g\/+f\/7v\/y\/\/T\/8v\/u\/+X\/2\/\/S\/9D\/0\/\/O\/9L\/3f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6\/\/z\/\/n\/\/v8CAAcACgAHAAMAAgACAPv\/\/P\/9\/\/7\/AwAMABAACgALAAoABAAEAAIA\/v\/4\/\/f\/9v\/4\/\/v\/\/P8AAAMABgAFAAgACQAKAAYAAgAAAP7\/\/P\/7\/\/v\/9\/\/5\/\/b\/9v\/0\/\/b\/9v\/4\/\/z\/AAD+\/\/z\/AAD\/\/wIABAACAP\/\/+\/\/8\/wMABwAQABQAFAAQAAwADAAQABAADQAMAA8AEAAMAA4AEQAWAB0AJAAnACUAJAAjACAAHQAcABsAGgAXABgAFwARABcAFwAYABkAGgAZABkAHQAeACkALgAtACgAKwArACgAJgAnACwAKwApACQAIAAbABgAFgASABAADAAHAAYACAAEAAMAAgABAAEA\/v\/5\/\/T\/+f\/3\/\/P\/9P\/3\/\/j\/9\/\/2\/+\/\/5\/\/l\/+H\/3v\/e\/9v\/1v\/R\/9P\/0v\/T\/9T\/0v\/Q\/9H\/zv\/J\/8n\/z\/\/R\/8r\/yP\/L\/83\/0f\/S\/9v\/3\/\/j\/+v\/7v\/2\/\/b\/9\/\/\/\/wIABQALAAoACgAPAAoABQAFAAMABQAHAAkACwA="},"stan":"43c556e0-c139-409a-b931-9861265eaac3","cmd":"audio","time":1553590202476,"type":0,"version":"1.0","entity":"resttest"}}

First Audio Chunk Response Body Sample

{"bk":{"protocol":"stream","code":0,"data":{"offset":0,"len":3200,"eos":false,"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82","text":[{"owner":"24ebecba-4fa4-11e9-9954-acb57df86553","type":"partial","value":""}],"utterance_id":"24ebecba-4fa4-11e9-9954-acb57df86553"},"stan":"43c556e0-c139-409a-b931-9861265eaac3","cmd":"audio","time":1553590202474,"type":1,"version":"1.0","entity":"resttest"}}

Next Audio Chunk Request Body Sample (normal)

{"bk":{"protocol":"stream","data":{"offset":3200,"len":3200,"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82","utterance_id":"24ebecba-4fa4-11e9-9954-acb57df86553","audio":"EAAbAB8AJA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9f\/2P\/Z\/+L\/5f\/p\/+\/\/7f\/r\/+7\/7v\/0\/\/L\/9P\/3\/\/b\/+f\/3\/\/T\/8\/\/0\/+\/\/6\/\/o\/+f\/6\/\/p\/+n\/5f\/d\/93\/2\/\/g\/+T\/4\/\/g\/+D\/4v\/k\/+3\/9\/\/7\/\/j\/8\/\/u\/+\/\/7P\/p\/+r\/6\/\/y\/\/v\/AAACAAAAAwALABMAFgAaABsAFwAWAA8ACQAFAAkADAATABYAFAATAA4ADgAKAAgACgALAAsACwAOABIAGQAUABYAGQAWABkAGwAgACEAJgArAC8ANQA2ADQALQAgABUACQAHAAAA\/v8DAAwAFwAWABQAGQAZABoAGAATAAkAAQAFAAQABAAGAAMA\/f\/9\/\/j\/9P\/q\/+L\/3v\/b\/9L\/zv\/P\/8v\/y\/\/H\/8n\/zf\/Q\/8v\/y\/\/S\/9L\/z\/\/J\/8r\/yf\/P\/87\/0\/\/V\/9H\/0v\/W\/9r\/2\/\/f\/9z\/3f\/l\/+z\/8P\/y\/\/b\/+v\/2\/\/D\/6v\/q\/+n\/5f\/m\/+b\/5\/\/k\/+D\/3f\/b\/97\/4f\/q\/+v\/7v\/0\/\/b\/\/P\/7\/\/v\/+\/\/3\/\/X\/+f8GAAoACAAIAAYABwAHAAUAAAD8\/\/v\/\/\/8IAAsADQATABAADQAKAAYAAgABAAIAAwAHAAoADwAbACEAJgAqACgAGwARAA8ABgD9\/\/P\/7v\/u\/+7\/8P\/u\/+7\/7\/\/y\/\/H\/8v\/x\/+7\/9\/8AAAQADQAUABkAGwAiABwAEQAHAPz\/9f\/o\/+j\/6\/\/t\/\/D\/9v\/1\/\/v\/\/P8AAAoACwAOABUAGgAXABkAFQAZACEAIwAnACoAKwAwADAAMgA="},"stan":"16951f87-c6e5-4b83-91dc-1da230a35275","cmd":"audio","time":1553590202555,"type":0,"version":"1.0","entity":"resttest"}}

Next Audio Chunk Response Body Sample (normal)

{"bk":{"protocol":"stream","code":0,"data":{"offset":3200,"len":3200,"eos":false,"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82","text":[{"owner":"24ebecba-4fa4-11e9-9954-acb57df86553","type":"partial","value":""}],"utterance_id":"24ebecba-4fa4-11e9-9954-acb57df86553"},"stan":"16951f87-c6e5-4b83-91dc-1da230a35275","cmd":"audio","time":1553590202546,"type":1,"version":"1.0","entity":"resttest"}}

Next Audio Chunk Request Body Sample (triger next_utterance_id)

{"bk":{"protocol":"stream","data":{"offset":326400,"len":3200,"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82","utterance_id":"24ebecba-4fa4-11e9-9954-acb57df86553","audio":"8\/8EABQAIwDw\/+z\/7P+9\/9P\/9\/\/d\/xoABAALAA4A8f8kAPz\/0v8LAO7\/DQArAPb\/IQABANz\/HADg\/+3\/FwD0\/x8ACQAVAAcARAAJAOX\/BwDS\/9j\/7v8MAPf\/EQD5\/9z\/CAD1\/+b\/CgDy\/wYA+\/8KACsABQDt\/xgA9v\/h\/x0AzP8DAPP\/x\/\/5\/9b\/3\/\/p\/+r\/BAD\/\/+H\/CgAHANn\/BADn\/93\/DQDh\/wcA+\/\/Y\/+3\/0\/\/K\/9n\/z\/\/T\/+z\/4v\/q\/\/7\/8P\/O\/+\/\/wf\/h\/9\/\/3\/\/t\/+H\/5\/\/T\/+3\/0f\/V\/9n\/5\/\/l\/\/7\/CgAaAP\/\/CwAGAOz\/9P\/l\/+D\/4\/\/r\/9v\/1f\/A\/8\/\/s\/+w\/8z\/wP\/Z\/\/T\/4v8IAP\/\/7\/8hAPz\/BQATAAIA8\/\/\/\/\/b\/5\/8QANP\/CAD9\/+v\/FwD6\/wcAFwAGAPv\/HgD1\/\/r\/CgD8\/xMAEwATABQABAAPAAkAKgAeAD0ASAAkAEcAIAAaAB0AEgAUAB0AKwA1AD0ALwAoACYAJwAbABoAJQAgACQAHgAuACIAJgAsADEARQBAACoANwAxABoALwAKABkAFwAeABgAFgAAAAoACADy\/x0A5P8LAPf\/EAD9\/\/3\/HADi\/wAA9\/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BgAdAFEAGwCq\/6n\/DQDX\/7D\/5P+5\/4z\/if\/e\/xIA7f+m\/6H\/4f+n\/7n\/HAAeAPn\/xf\/a\/xYAGADO\/w8AEgABANn\/9f8hAPv\/KwA="},"stan":"9909debe-6197-49a5-8e4d-b72ab41d1f45","cmd":"audio","time":1553590211724,"type":0,"version":"1.0","entity":"resttest"}}

Next Audio Chunk Response Body Sample with ‘next_utterance_id

{"bk":{"protocol":"stream","code":0,"data":{"next_utterance_id":"2b467f4f-4fa4-11e9-9954-acb57df86553","offset":326400,"len":3200,"eos":true,"uoffset":0,"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82","utterance_id":"24ebecba-4fa4-11e9-9954-acb57df86553","position":328448,"text":[{"owner":"24ebecba-4fa4-11e9-9954-acb57df86553","type":"partial","value":"kota"},{"owner":"24ebecba-4fa4-11e9-9954-acb57df86553","type":"partial","value":"yang"},{"owner":"24ebecba-4fa4-11e9-9954-acb57df86553","type":"partial","value":"sangat"},{"owner":"24ebecba-4fa4-11e9-9954-acb57df86553","formatted":"Kun beban yang sangat berat karena Jakarta adalah 1 kota yang sangat kompleks","type":"final","value":"kun beban yang sangat berat karena Jakarta adalah 1 kota yang sangat kompleks"},{"owner":"24ebecba-4fa4-11e9-9954-acb57df86553","formatted":" ","type":"final","value":" "},{"owner":"24ebecba-4fa4-11e9-9954-acb57df86553","type":"partial","value":""}]},"stan":"9909debe-6197-49a5-8e4d-b72ab41d1f45","cmd":"audio","time":1553590213101,"type":1,"version":"1.0","entity":"resttest"}}

Next Audio Chunk Request Body Sample (replacing utterance_id with next_utterance_id)

{"bk":{"protocol":"stream","data":{"offset":329600,"len":3200,"uoffset":0,"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82","position":328448,"audio":"MgBDAFIAZgBhAFkARADx\/7P\/vv8FAB8Azv+2\/6b\/b\/9u\/6b\/CAAtAGAAMwANACkA9P8MADkAjABxAEoAawBeAEYARgAgAO3\/HAAgADgASQBQAB8Ay\/+M\/6v\/+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\/2n\/o\/\/3\/zEA7v+e\/9P\/u\/9j\/0r\/kP\/b\/8X\/m\/\/m\/z0AHADU\/8r\/0P+P\/17\/hP\/m\/0QAMwAgADAADADq\/8j\/0v\/7\/wEADQBoAIMAIADb\/\/P\/6v\/s\/yEAMABNADEAyv\/J\/wAAGQApACsAGQD2\/\/D\/8P\/p\/9X\/+f8iABcA\/v\/P\/6r\/s\/\/p\/xkAFwDr\/wEALAAsAE8ATQBIADsACQASACMAIwA6ADgA\/v\/W\/83\/0f8KAGIAegBOAPz\/7v8SABIAJwBXAE0AXwBiAAAA3P\/9\/yMAFgAJAOb\/8v\/7\/+\/\/3f\/P\/xYAJwAQADQAVQAHALL\/uv8sAFMAMwA4AEMASgD7\/7v\/KwBqACcACgAAAOT\/nf+u\/+P\/EADp\/7X\/+\/8TAOn\/0f\/1\/\/H\/tP+Y\/\/r\/eQCJAE4ADgD+\/wwA\/P8wAKwAzwBZANz\/CgAFANX\/wv\/K\/8n\/r\/+\/\/\/X\/\/P\/2\/wgAyP\/L\/\/v\/EQAwAHMARADR\/9v\/BgDQ\/8P\/JQBYAAoAwP\/K\/wAABwDC\/7z\/1\/\/+\/+P\/sf\/T\/\/7\/w\/+Y\/2X\/QP89\/0L\/rf8=","utterance_id":"2b467f4f-4fa4-11e9-9954-acb57df86553"},"stan":"842083c4-916f-4909-97e4-a445ef7bba70","cmd":"audio","time":1553590213173,"type":0,"version":"1.0","entity":"resttest"}}

Next Audio Chunk Response Body Sample (after replacing utterance_id with next_utterance_id)

{"bk":{"protocol":"stream","code":0,"data":{"offset":329600,"len":3200,"uoffset":0,"eos":false,"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82","utterance_id":"2b467f4f-4fa4-11e9-9954-acb57df86553","position":328448,"text":[{"owner":"2b467f4f-4fa4-11e9-9954-acb57df86553","type":"partial","value":""}]},"stan":"842083c4-916f-4909-97e4-a445ef7bba70","cmd":"audio","time":1553590213165,"type":1,"version":"1.0","entity":"resttest"}}

End of Stream

When audio is completely transferred, you have to end the stream so that your state in engine will not be maintained any longer. Whether you signal eos or not, whenever your token is expired, the state will be wiped and you need to redo everything from requesting token.

Header

Key Value
content_type application/json
Accept-Charset UTF-8
Authorization Bearer access_token

Note:
access_token is obtained from OAuth2

Payload

Key Child Key Grand Child Key Value
bk protocol stream
bk cmd eos
bk entity your_entity_name
bk stan stan_uuid
bk time current_time
bk version 1.0
bk type type_message
bk data session_id session_id
bk data utterance_id utterance_id
bk code code

Note:
stan_uuid is regenerated
session_id is obtained session_id from init response
● see mandatory properties

Usages:

curl -X POST 'https://api-dev.bahasakita.co.id/speech' -H "Content-type: application/json" -H "Authorization: Bearer replace_with_access_token" -d '{"bk": {"type": 0, "data": {"session_id": "replace_with_session_id", "utterance_id": replace_with_utterance_id, "stan": "replace_with_stan_uuid", "time":replace_with_current_time , "cmd": "eos", "protocol": "stream", "entity": "replace_with_your_entity_name", "version": "1.0"}}' --cacert "api-dev.bahasakita.co.id.pem"

End of Stream(eos) Request Body Sample

{"bk":{"protocol":"stream","data":{"offset":636800,"len":3200,"uoffset":0,"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82","utterance_id":"2b467f4f-4fa4-11e9-9954-acb57df86553","position":328448},"stan":"58d41cdb-3b45-409d-9c4a-f98d4a2f655b","cmd":"eos","time":1553590229890,"type":0,"version":"1.0","entity":"resttest"}}

End of Stream(eos) Response Body Sample

{"bk":{"protocol":"stream","code":0,"data":{"offset":636800,"len":3200,"uoffset":328448,"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82","utterance_id":"2b467f4f-4fa4-11e9-9954-acb57df86553","position":311552,"text":[{"owner":"2b467f4f-4fa4-11e9-9954-acb57df86553","type":"partial","value":"sepertinya"},{"owner":"2b467f4f-4fa4-11e9-9954-acb57df86553","formatted":"tumplek di sini ke tapi sepertinya","type":"final","value":"tumplek di sini ke tapi sepertinya"},{"owner":"2b467f4f-4fa4-11e9-9954-acb57df86553","formatted":" ","type":"final","value":" "}]},"stan":"58d41cdb-3b45-409d-9c4a-f98d4a2f655b","cmd":"eos","time":1553590229867,"type":1,"version":"1.0","entity":"resttest"}}

Close Session

Closing session is intended to release a session of Notula Speech API service. To release session you need to request POST comprised by header and payload as follows

Header

Key Value
content_type application/json
Accept-Charset UTF-8
Authorization Bearer access_token

Note :
access_token is obtained from OAuth2

Payload

Key Child Key Grand Child Key Value
bk protocol stream
bk cmd end
bk entity your_entity_name
bk stan stan_uuid
bk time current_time
bk version 1.0
bk type type_message
bk data session_id session_id
bk code code

Note:
stan_uuid is regenerated
session_id is obtained session_id from end of stream response
● see mandatory properties

Usages:

curl -X POST 'https://api-dev.bahasakita.co.id/speech' -H "Content-type: application/json" -H "Authorization: Bearer replace_with_access_token" -d '{"bk": {"type": 0, "data": {"session_id": "session_id", "stan": "stan_uuid", "time":current_time , "cmd": "end", "protocol": "stream", "entity": "my_entity", "version": "1.0"}}' --cacert "api-dev.bahasakita.co.id.pem"

End of Session Request Sample

{"bk":{"protocol":"stream","data":{"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82"},"stan":"3242598c-6e50-4d4a-ae03-df8a583c415d","cmd":"end","time":1553590229870,"type":0,"version":"1.0","entity":"resttest"}}

End of Session Response Sample

{"bk":{"protocol":"stream","code":0,"data":{"session_id":"21b934c6-796d-4415-b06a-345bd5efaf82"},"stan":"3242598c-6e50-4d4a-ae03-df8a583c415d","cmd":"end","time":1553590229870,"type":1,"version":"1.0","entity":"resttest"}}

Audio Format

Accepted Format

As a common format, we restrict the audio that is streamed throughout the API has to be WAV formatted with 16 KHz sampling rate, 1 channel, and 16 bit precision (Signed Integer PCM) . We do not serve any resampler, therefore the streamed audio will be assumed qualified and processed as it is. Unless the audio fulfill these format, the yielded transcription will be meaningless. In order to do that, use tools like sox, ffmpeg, or other python library to have it formatted in right way. Yet we really do not recommend upsampling from lower sampling rate audio, interpolating from lower bit precision, and conversion from lossy format (eg. mp3, ogg, etc) to WAV since from the very beginning there have been data loss on these cases.

Chunking and Conversion

WAV is embodied by two main parts : headers and data. Headers span 44 bytes length and the rest is audio data itself. We would not need the header at all since we have made assumption above. So we skip this index 0 to 43 which are headers and move on to processing the data.

While streaming the audio data, we do not entirely send the data all at once, but break apart them into smaller chunks. These chunks are sized maximally particular W bytes or less than that. W is either 3200 or 6400 or 12800 or more which has to be set the same for whole processes. Based on best practice, we recommend to set W base on your network quality. Furthermore, only the last chunk which eventually less than W bytes. You can either leave it as it is or append zero padding to suffice the size. Each chunk need to be converted to base64 string before inserted into request body.


Error Messages

When an error occurs, the Speech API will provide the error code in the code property of response. The errors shown in the following table

Code Error
1 ERROR
2 CMD_UNRECOGNIZE
3 PLATFORM_RULES_ERROR
4 FIELD_BK_FORMAT_INVALID
5 FIELD_CMD_FORMAT_INVALID
6 FIELD_DATA_FORMAT_INVALID
7 FIELD_ENTITY_FORMAT_INVALID
8 FIELD_PROTOCOL_FORMAT_INVALID
9 FIELD_STAN_FORMAT_INVALID
10 FIELD_TIME_FORMAT_INVALID
11 FIELD_TYPE_FORMAT_INVALID
12 FIELD_VERSION_FORMAT_INVALID
13 STREAM_SESSION_NOT_REGISTERED
14 STREAM_SESSION_ALREADY_REGISTERED
15 STREAM_SESSION_STATE_GET_FAIL
16 STREAM_SESSION_STATE_UPDATE_FAIL
17 STREAM_SESSION_WORKER_NOT_AVAILABLE
18 STREAM_SESSION_WORKER_ERROR_ON_TRANSCRIPTION_PROCESS
19 STREAM_SESSION_WORKER_TIMEOUT_ON_TRANSCRIPTION_PROCESS
20 STREAM_SESSION_MANDATORY_EOS
21 UTTERANCE_CREATE_FAIL
22 UTTERANCE_UPDATE_FAIL
23 BOS_REJECTED
24 UPLOAD_NOT_EXIST
25 UPLOAD_DELETE_FAIL
26 UPLOAD_STATE_UPDATE_FAIL
27 UPLOAD_REGISTER_FAIL
28 ACTIVITY_GET_FAIL
29 ACTIVITY_RELEASE_FAIL
30 ACTIVITY_PROCESS_FAIL
31 ACTIVITY_STILL_USED_ANOTHER_PROCESS
32 PROTOCOL_INVALID_NAME
33 FIELD_IS_MISSING
34 IO_ERROR
35 FIELD_TYPE_INALID
36 NEED_BOS_REQUEST
37 WORKER_NOT_AVAILABLE
38 ANALYTIC_RESET_FAIL
39 ANALYTIC_EXPORT_FAIL
40 WORKER_TIMEOUT_ON_IDENTIFICATION_PROCESS
41 WORKER_TIMEOUT_ON_VERIFICATION_PROCESS
42 WORKER_TIMEOUT_ON_DIARIZATION_PROCESS
43 OAUTH_USER_EMAIL_ALREADY_EXIST
44 OAUTH_USER_EMAIL_SCOPE_ALREADY_EXIST
45 OAUTH_USER_EMAIL_NOT_FOUND
46 OAUTH_USER_EMAIL_VERIFICATION_FAILED
47 OAUTH_USER_EMAIL_HAS_BEEN_ACTIVE
48 OAUTH_USER_EMAIL_NOT_ACTIVE
49 OAUTH_SCOPE_NOT_FOUND
50 OAUTH_PASSWORD_RESET_FAILED
51 OAUTH_PASSWORD_CHANGE_FAILED
52 OAUTH_PASSWORD_BAD_TOKEN
53 TRANSCRIPTION_AUDIO_FAILED
54 TRANSCRIPTION_EOS_FAILED
55 TRANSCRIPTION_BOS_FAILED
56 TRANSCRIPTION_INIT_FAILED
57 TRANSCRIPTION_END_FAILED
58 SPEAKER_EMPTY_RESULT
59 SPEAKER_ENROLLMENT_FAILED