This document contains the reference documentation for Phonexia Speech Engine interface, version 3.63.1. Interface is designed for developers who want to integrate Phonexia speech technologies into their own desktop or web applications. API documentations for previous versions (formally named Phonexia REST API until version 3.2.1) are available here.
Phonexia Speech Engine interface provides access to operations via the URI path. The client application must create and submit a request and then receive and analyze the response from the server. Nowadays Phonexia uses the REST-like interface for entire communication protocol XML (or JSON) and standard HTTP methods GET, POST, DELETE and PUT.
Commands are divided into two basic types - synchronous and asynchronous. When request for a synchronous operation is sent, response is always in the reply. In terms of an asynchronous request an asynchronous request ID is sent back to the client. With this asynchronous request ID, client can monitor the state of asynchronous requests (Asynchronous request).
Response format can be specified in request header or in request query.
Settings in request query has higher priority. If neither query or accepted property is not set, response format will be JSON.
SPE generates a unique request ID for every incoming request. This unique ID is written to the log as RID. The request ID is a 16-bit unsigned number incrementing for each request. You can specify your own ID in the HTTP header parameter X-Request-ID. It can contain up to 50 arbitrary characters. Each server's response also contains X-Request-ID header parameter with the request ID.
Asynchronous request is used for time-consuming task processing. Each asynchronous request is marked with the asynchronous keyword in this documentation. Server allows these ways of receiving asynchronous request result:
GET /technologies/speakerid?path=/recording.wav&speaker_model=david&model=S
< HTTP/1.1 202 Accepted < Date: Sat, 06 Aug 2016 09:11:57 GMT < Connection: Close < Content-Type: application/json < Location: /pending/54048266-b694-440a-8a9e-0cef5668efea
{ "result": { "version": 2, "name": "PendingInfoResult", "info": { "id": "54048266-b694-440a-8a9e-0cef5668efea", "state": "waiting", "priority": 50 } } }
If result of asynchronous request is already in cache, final reply (HTTP status 200) is returned instead of redirecting to GET /pending/{id}.
GET /pending/54048266-b694-440a-8a9e-0cef5668efea
Example response (operation has not been completed yet):
< HTTP/1.1 200 OK < Date: Sat, 06 Aug 2016 09:12:00 GMT < Connection: Close < Content-Type: application/json
{ "result": { "version": 2, "name": "PendingInfoResult", "info": { "id": "54048266-b694-440a-8a9e-0cef5668efea", "state": "running", "priority": 50 } } }
Example response (operation has been completed):
< HTTP/1.1 303 See Other < Date: Sat, 06 Aug 2016 09:12:03 GMT < Connection: Close < Content-Type: application/json < Location: /done/54048266-b694-440a-8a9e-0cef5668efea
{ "result": { "version": 2, "name": "PendingInfoResult", "info": { "id": "54048266-b694-440a-8a9e-0cef5668efea", "state": "finished", "priority": 50 } } }
GET /done/54048266-b694-440a-8a9e-0cef5668efea
< HTTP/1.1 200 OK < Date: Sat, 06 Aug 2016 09:12:06 GMT < Connection: Close < Content-Type: application/json
{ "result": { "version": 2, "name": "SpeakerIdentificationMultiResult", "model": "S", "speaker_group": "", "calibration_set": "", "max_fa_rate": 0, "results": [ { "file": "/recording.wav", "speaker_model": "david", "channel_scores": [ { "channel": 0, "scores": [ { "score": -13.1162815 } ] } ] } ] } }
The result will be available for a limited time (by default 60 seconds, can be configured on server). Then the result will expire and requests GET /done/{id}, GET /pending/{id} with specific ID will return error (HTTP status 404). Result also will not be available after GET /done/{id} is successfully called.
Server allows open WebSocket for receiving result without repeated sending of GET /pending/{id} request.
GET /technologies/speakerid?path=/recording.wav&speaker_model=david&model=S
< HTTP/1.1 202 Accepted < Date: Sat, 06 Aug 2016 09:11:57 GMT < Connection: Close < Content-Type: application/json < Location: /pending/54048266-b694-440a-8a9e-0cef5668efea
{ "result": { "version": 2, "name": "PendingInfoResult", "info": { "id": "54048266-b694-440a-8a9e-0cef5668efea", "state": "waiting", "priority": 50 } } }
If result of asynchronous request is already in cache, final reply (HTTP status 200) is returned instead of redirecting to GET /pending/{id}.
GET /pending/54048266-b694-440a-8a9e-0cef5668efea HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw== Sec-WebSocket-Version: 13 X-SessionID: 258f505c-a6fa-4c3f-8a87-b048874ac6aa Accept: application/json
The server allows sending HTTP callback (webhook) when the asynchronous request is done. URL of the callback is specified in asynchronous request HTTP header in parameter X-WebhookTarget.
GET /technologies/speakerid?path=/recording.wav&speaker_model=david&model=S
Complete example HTTP request header will look:> GET /technologies/speakerid?path=/recording.wav&speaker_model=david&model=S HTTP/1.1 > Host: server.example.com:8600 > Accept: application/json > X-SessionID: 27508c43-1f48-46c9-bdaa-f00cec181444 > X-WebhookTarget: http://webhook-target.example.com:8601
< HTTP/1.1 202 Accepted < Date: Wed, 29 Nov 2017 17:24:00 GMT < Connection: Close < Content-Type: application/json < X-TaskID: 1edbede9-c5af-4ec4-b457-81ba01a8472d
{ "result": { "version": 2, "name": "PendingInfoResult", "info": { "id": "1edbede9-c5af-4ec4-b457-81ba01a8472d", "state": "waiting", "priority": 50 } } }
Webhook callback is now registered and the result of the asynchronous request will be delivered to the webhook target address when it is done.
When the asynchronous request is done, server sends callback request with HTTP POST method. HTTP header of callback request contains parameter X-TaskID. This Task ID is the same as it is returned in reply of asynchronous request.
The server expects HTTP status 2xx as reply. Any other information returned in the request headers or request body is ignored. All response codes outside this range will indicate that webhook was not recieved. In case of webhook fail it is still possible to get result by request GET /done/{id}.
For asynchronous requests which has used Webhook is not possible to use WebSocket or Polling.
This example demonstrates work with asynchronous requests. Requires jQuery v2+ and PHP 5.3.4 (or later).
Due to long time executing of asynchronous requests it is not appropriate to implement waiting cycle in PHP. In this sample the waiting cycle is implemented on client side (JavaScript). PHP server is used only for request forwarding from JS client to Phonexia Speech Engine.
File: example.php
<?php $SERVER_ADDRESS = 'http://127.0.0.1:8600'; $SESSION_ID = '9b9de740-eb30-49c0-a2ff-2548491c328a'; // this example does not deal with user authentication. $options = array( 'http' => array ( 'method' => $_SERVER['REQUEST_METHOD'], 'header' => 'X-SessionID: ' . $SESSION_ID . "\r\n" . 'Content-Type: application/json', 'content' => $_POST['content'], 'max_redirects' => 10, 'follow_location' => 1, 'ignore_error' => true, ) ); $context = stream_context_create($options); /** Get response **/ $response_body = @file_get_contents($SERVER_ADDRESS . $_GET['request'], false, $context); $response_headers = isset($http_response_header) ? $http_response_header : array(); /** Set HTTP 500 if error ocurred **/ if (empty($response_headers) && !$response_body) { $response_headers[] = 'HTTP/1.0 500 Internal server error'; } /** Set response headers **/ foreach ($response_headers as $header_string) { header($header_string); } /** Print response body **/ if (!is_null($response_body)) { print $response_body; }
There are helper functions for working with asynchronous requests in JavaScript. Method async_request() begins asynchronous request. Object options and using example is shown below. Method pending() is used in async_request() and performs waiting cycle for result.
File: example.js
// example Asynchronous request support functions var PENDING_TIMEOUT = 300; // 0.3 sec - waiting between pending requests function async_request(options) { // create request address from options.technology_params var request = options.uri_path + '?'; for (var param in options.uri_params) { if (options.uri_params.hasOwnProperty(param)) { request += param + '=' + options.uri_params[param] + '&'; } } // send ajax $.ajax({ url: 'example.php?request=' + encodeURIComponent(request), method: options.method, data: { request: request, content: (options.content !== undefined ? JSON.stringify(options.content) : "") }, dataType: 'json', success: function(response) { if (is_pending(response)) { // result is not yet - do pending requests cycle pending(response.result.info.id, options.callback); } else { // result is available options.callback(response); } }, error: function() { alert('Unable to get result.'); } }); } function is_pending(response) { return response.result.name == 'PendingInfoResult'; }; function pending(id, callback) { var pending_worker = function() { $.ajax({ url: 'example.php', method: 'GET', data: { request: '/pending/' + id }, dataType: 'json', success: function(response) { if (is_pending(response)) { // result is not yet available setTimeout(pending_worker, PENDING_TIMEOUT); } else { // result is available callback(response); } }, error: function() { alert('Unable to get pending result.'); } }); }; pending_worker(); };
There is specific use case for Speaker Identification technology. Other asynchronous requests can be achieved by setting object options.
Object options paramaters description:
Speaker Identification asynchronous request example:
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="example.js"></script> <script type="text/javascript"> var options = { method: 'GET', uri_path: '/technologies/speakerid', uri_params: { path: '/julia.wav', model: 'L', speaker_model: 'julia' }, callback: function(result) { console.log(result); // work with result $('#output').text(JSON.stringify(result)); } }; $(function() { async_request(options); }); </script> <body> <pre id="output"><pre> </body> </html>
Phonexia Speech Engine allows configure priority of each asynchronous task (except streams). Priority is defined by number from 0 (highest priority) to 99 (lowest priority). Tasks are processed according to their priorities. If task with highest priority requires technology which is not available at that time, the task with lower priority may be launched. If two or more tasks have same priority, FIFO approach is used. Only users with prioritize role can change priority of tasks otherwise default priority is used. Default priority is 50 (it can be changed in configuration, you can use GET /server/info request to check current value).
Note: If user doesn't have role prioritize the task is created with default priority without any error.
Prioritization can be disabled in configuration (use GET /server/info request to check if server supports it).
Priority is set by HTTP header X-Priority:
> GET /technologies/speakerid?path=/recording.wav&speaker_model=david&model=S HTTP/1.1 > Host: server.example.com:8600 > Accept: application/json > X-SessionID: 27508c43-1f48-46c9-bdaa-f00cec181444 > X-Priority: 28
{ "result": { "version": 2, "name": "PendingInfoResult", "info": { "id": "54048266-b694-440a-8a9e-0cef5668efea", "state": "waiting", "priority": 28 } } }
Priority of the task is returned in PendingInfoResult result. You can also use GET /tasks to check tasks priorities.
Authentication is the mechanism of associating an incoming request with a set of identifying credentials, such as the user the request came from, or the token X-SessionID as the signature of requests. The permission and throttling policies can then use these credentials to determine if the request should be permitted.
Phonexia Speech Engine provides two authentication methods: Token authentication and HTTP basic authentication.
Example login request and response:
> POST /login HTTP/1.1 > Host: localhost:8600 > Authorization: Basic YWRtaW46cGhvbmV4aWE= > < HTTP/1.1 200 OK < Date: Thu, 28 Jul 2016 08:04:24 GMT < Connection: Close < Content-Type: application/json < X-SessionID: 561b0b4c-3dd2-48e7-9353-ba5a73a554c1 {"result":{"version":1,"name":"UserSessionResult","session":{"id":"561b0b4c-3dd2-48e7-9353-ba5a73a554c1"}}}
Example request header with session parameter:
> GET /technologies HTTP/1.1 > Host: localhost:8600 > X-SessionID: 561b0b4c-3dd2-48e7-9353-ba5a73a554c1
Example request header with basic authentication:
> GET /technologies HTTP/1.1 > Host: localhost:8600 > Authorization: Basic YWRtaW46cGhvbmV4aWE=
Server supports following encodings:
Send request to open RTP input stream (POST /input_stream/rtp), HTTP chunked input stream (POST /input_stream/http) or WebSocket input stream (POST /input_stream/websocket).
Response to this request should contain Input stream ID and number of opened Port (only for RTP input streams). Server has limited number of free ports for streams and if this count is exceed, HTTP status 403 (Forbidden) is returned. Stream is automatically closed, if no data is sent for longer than 10sec (default value, can be configured on server settings).
Send request to bind technology to opened stream (e.g. POST /technologies/stt/input_stream). Response to this request should contain Task ID (used in request to get result).
It is possible to unbind the technology in any moment of the stream duration (e.g. DELETE /technologies/stt/input_stream). If technology is unbound, getting results (e.g. GET /technologies/stt/input_stream) will not be possible.
It is possible to bind more technologies to one opened stream.
Result modes (only for STT, KWS, VAD)Results of some technologies can be obtained in different ways. Result mode can be set when binding technology to the input stream and can not be changed during runtime of a task.
If the input stream is successfully opened and client has Input stream ID and port (given in step 1.), client can start sending data into the stream.
Supported RTP Payload types are:
Supported format in HTTP chunked stream is RAW s16le. Frequency and number of channels is defined by request POST /input_stream/http
Supported format in WebSocket stream is RAW s16le. Frequency and number of channels is defined in request's query parameters.
Important notice: Multichannel input stream can be used only in connection with Time Analysis Stream Technology. Other stream technologies currently does not support multichannel stream.
Getting the results is possible using one of following ways:
Simultaneously while streaming data, it is possible to get current results (e.g. GET /technologies/stt/input_stream). Getting results is possible until the result contains is_last=true flag. The point is that even if the input stream gets closed, technologies can still continue processing of remaining data and additional results can be obtained.
The server allows to open WebSocket for receiving results during stream task processing. To send WebSocket handshake request, use GET request of used technology (e.g. GET /technologies/stt/input_stream).
WebSocket handshake request should contain the following parameters in the header: Upgrade, Connection, Sec-WebSocket-Version, Sec-WebSocket-Key and session parameter (X-SessionID) or basic authorization (Authorization).
GET /technologies/stt/input_stream?task=54048266-b694-440a-8a9e-0cef5668efea&interval=0.33 HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw== Sec-WebSocket-Version: 13 X-SessionID: 258f505c-a6fa-4c3f-8a87-b048874ac6aa Accept: application/json
Partial results of the streaming task are sent periodically via WebSocket message. The query parameter interval sets minimum interval of sent messages; actual interval may be greater, depending on input data. WebSocket is opened until the streaming task is finished. The last result contains is_last=true flag. WebSocket is closed after the last result by server.
If an error occurs during stream processing, the error message is sent through WebSocket and then the connection is immediately closed.
Only one WebSocket can be opened for one streaming technology task and it is not possible to combine WebSocket with Webhook.
The server allows to register Webhook callback for receiving results during stream task processing. To register Webhook callback, send GET request of used technology (e.g. GET /technologies/stt/input_stream) and use X-WebhookTarget HTTP header containing webhook URL.
Example HTTP request for registration of Webhook callback (the technology is expected to run):
GET /technologies/stt/input_stream?task=54048266-b694-440a-8a9e-0cef5668efea&interval=0.33 HTTP/1.1 Host: server.example.com:8600 Accept: application/json X-SessionID: 27508c43-1f48-46c9-bdaa-f00cec181444 X-WebhookTarget: http://webhook-target.example.com:8601
The server returns a response with HTTP code 202.
Partial results of the streaming task are sent periodically to Webhook callback. The query parameter interval sets interval of Webhook calls. Webhook callback is automatically unregistered after the last result is delivered (last result contains is_last=true flag).
If an error occurs during stream processing, the error message is sent to Webhook callback and then Webhook callback is immediately unregistered.
Only one Webhook callback can be registered for one streaming technology task and it is not possible to combine Webhook with WebSocket.
See also specific technologies for more information:
After all the audio data are sent it is recommended to send request to close the stream (DELETE /input_stream/rtp or DELETE /input_stream/http).
The input stream is automatically closed, if no data is sent for more than 10 seconds (default value, can be configured via server settings).
In addition, WebSocket stream is stopped immediately
Responses with HTTP statuses 4xx/5xx (except 501) returns in content JSON/XML object with error code and message.
{ "result" : { "version" : 2, "name" : "ErrorResult", "code" : 1003, "message" : "A required query parameter was not specified for this request" } }
<?xml version='1.0' encoding='UTF-8'?> <result> <version>2</version> <name>ErrorResult</name> <code>1003</code> <message>A required query parameter was not specified for this request</message> </result>
If unknown server error (HTTP code 500) happens, response header will contain additional property (X-ExceptionType). This property specifies type of exception which caused unknown error.
Error code | Error message | Http code | Http status |
---|---|---|---|
1000 | Unknown server error | 500 | Internal Server Error |
1001 | The requested URI does not represent any resource on the server | 400 | Bad Request |
1002 | The URL in the request could not be parsed | 400 | Bad Request |
1003 | A required query parameter was not specified for this request | 400 | Bad Request |
1004 | An invalid value was specified for one of the query parameters in the request URI | 400 | Bad Request |
1005 | The request requires user authentication | 401 | Unauthorized |
1006 | The server not supported this request | 501 | Not Implemented |
1007 | Unsupported audio format | 415 | Unsupported Media Type |
1008 | File not found | 404 | Not Found |
1009 | Technology is not supported by server | 405 | Method Not Allowed |
1010 | Task not found | 404 | Not Found |
1011 | Execute access forbidden | 403 | Forbidden |
1012 | Keyword list not found | 404 | Not Found |
1013 | Unsupported | 405 | Method Not Allowed |
1014 | Size of uploaded file exceeds size limit | 413 | Request Entity Too Large |
1015 | User model not found | 404 | Not Found |
1016 | User model already exist | 400 | Bad Request |
1017 | User model not ready | 400 | Bad Request |
1018 | The requested URI requires content | 400 | Bad Request |
1019 | An invalid data was specified in the request content | 400 | Bad Request |
1020 | User does not exist | 404 | Not Found |
1021 | User already exists | 400 | Bad Request |
1023 | Exceed maximum count of users pending operation | 503 | Service Unavailable |
1024 | Result not found | 404 | Not Found |
1025 | An invalid value was specified for one of the header parameters in the request | 400 | Bad Request |
1026 | RTP sessions limit exceeded | 403 | Forbidden |
1027 | Task is not stream task | 404 | Not Found |
1028 | Worker limit exceeded | 503 | Service Unavailable |
1030 | Stream not found | 404 | Not Found |
1031 | Resource not available | 503 | Service Unavailable |
1032 | Unable to prepare calibration set | 406 | Not Acceptable |
1033 | Unable to prepare speaker model | 406 | Not Acceptable |
1034 | Unable to prepare group of speaker models | 406 | Not Acceptable |
1035 | Invalid time range | 406 | Not Acceptable |
1036 | Unsupported format was specified in header | 406 | Not Acceptable |
1037 | Server license is not valid | 500 | Internal Server Error |
1038 | Resource is locked | 400 | Bad Request |
1039 | It was necessary to rename uploaded file but it could not be done, because file with same name already exists | 400 | Bad Request |
1041 | Multichannel recording is not allowed | 400 | Bad Request |
1042 | WebSocket has already been opened for this operation | 400 | Bad Request |
1043 | Can't create WebSocket | 400 | Bad Request |
1044 | Can't create WebSocket because user has registered webhook | 400 | Bad Request |
1050 | Technology does not support multichannel stream | 400 | Bad Request |
1051 | Invalid path syntax | 400 | Bad Request |
1052 | Invalid keyword list | 400 | Bad Request |
1053 | Connection to reporting server was lost | 500 | Internal Server Error |
1054 | Unsupported Audio Source Profile format | 415 | Unsupported Media Type |
1055 | Audio Source Profile already exists | 400 | Bad Request |
1056 | Audio Source Profile hash mismatch | 400 | Bad Request |
1057 | Audio Source Profile voiceprint version mismatch | 400 | Bad Request |
1058 | Bad configuration of Audio Source Profile | 400 | Bad Request |
1059 | Size of registered file exceeds size limit | 413 | Request Entity Too Large |
1060 | The capacity for technology has been exceeded | 400 | Bad Request |
1061 | The result is not available | 400 | Bad Request |
1062 | External technology not found | 404 | Not Found |
1063 | Access to file is forbidden | 403 | Forbidden |
1064 | Maximum number of tasks limit exceeded | 503 | Service Unavailable |
1065 | Unable to read file | 400 | Bad Request |
1066 | Unable to register language pack. See server log for additional information. | 400 | Bad Request |
1067 | Invalid format of multipart request | 400 | Bad Request |
1068 | Unsupported format | 415 | Unsupported Media Type |
1069 | WebHook has already been registered | 400 | Bad Request |
1070 | Can't register WebHook because WebSocket has been registered | 400 | Bad Request |
1071 | Technology is running | 403 | Forbidden |
1072 | Model not found | 404 | Not Found |
1073 | An uknown parameter was submitted | 400 | Bad Request |
1074 | Not available while a task is still running | 403 | Forbidden |
Resource locker is used for locking resources during asynchronous request is executed. Asynchronous request locks all used resources (such as File, Speaker Model, etc.) until request finish. Resource can not be edited, moved or removed until it is locked. Locked resource is still accessible for reading and can be analyzed by another asynchronous request.
Resource locker can be disabled in server settings.
List of resource types:
See also:
Added possibility to get multiple STT result types at once using single request. Parameter result_type now can take multiple values separated by a comma. Result uses a new name (SpeechRecognitionResult) when using multiple result types. The version of all SpeechRecognitionOneBestResult, SpeechRecognitionNBestResult, SpeechRecognitionCNResult, and SpeechRecognitionResult changed from v3 to v4.
See: GET /technologies/stt
Result of STT (N-best) now contains phrase start and end time. See: GET /technologies/stt
Reply ServerInfoResult(v2) on request GET /server/info returns information about running plugins
Removed actual_task_count, task_limit, added new statistics about current server load (see GET /loadstatistics)
TechnologiesResult(v2) - result->technologies->models now returns array of objects (containing name, n_total_instancies, n_busy_instancies) instead of array of model names.
This change causes technologies has optional output parameter time_range in result. Also version of affected result is changed to version 2.
Request POST /technologies/speakerid/groups/{name}/speakermodel has new behaviour. Original behaviour of this request is moved to PUT /technologies/speakerid/groups/{name}/speakermodel
Added parameter version to error response result
Changed AudioFileInfoResult - added parameter format
Returns information about user selected by login. Access to this method is allowed only for users with "admin" role.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
login | query | string | yes | User login |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/admin/user?login=james"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $LOGIN = "james"; //= user's login $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/admin/user?login=$LOGIN", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "UserResult", "user": { "login": "james", "active": true, "roles": [ "user", "admin" ] } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>UserResult</name> <user> <login>james</login> <active>true</active> <roles> <item>user</item> <item>admin</item> </roles> </user> </result> |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
404Not Found |
|
Create new user. Body of request has to contain user's data. It is possible to set the Content-Type parameter in the request header which is helpful in case the client wants to send input data in XML format. Access to this method is allowed only for users with "admin" role.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content. |
login | json/xml content | string | yes | new user's login |
password | json/xml content | string | yes | new user's password |
active | json/xml content | boolean | no | new user's active status |
roles | json/xml content | list of strings | no | new user's roles |
{ "user": { "login": "james", "password": "password1234", "active": true, "roles": [ "user", "admin" ] } }
<?xml version="1.0" encoding="UTF-8"?> <user> <login>james</login> <password>password1234</password> <active>true</active> <roles> <item>user</item> <item>admin</item> </roles> </user>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary @"new_user.json" "SERVER_ADDRESS:PORT/admin/user"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $user_data = array( 'user' => array ( 'login' => 'james', 'password' => 'password1234', 'active' => true, 'roles' => array ( 'user', 'admin' ) ) ); $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: application/json', 'content' => json_encode($user_data), 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/admin/user", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
Delete user from server. All user's data (all recordings, results, settings) will be deleted. Access to this method is allowed only for users with "admin" role.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
login | query | string | yes | selected user's login |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/admin/user?login=james"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $LOGIN = "james"; //= user's login $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/admin/user?login=$LOGIN", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
404Not Found |
|
Change user settings. Body of request contains changed user's settings. It is possible to set the Content-Type parameter in the request header which is helpful in case the client wants to send input data in XML format. Currently, it is not possible to change user's login. Access to this method is allowed only for users with "admin" role.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content. |
login | query | string | yes | selected user's login |
login | json/xml content | string | yes | user's login - currently, it is not possible to change it |
password | json/xml content | string | no | changed password |
active | json/xml content | boolean | no | changed active status |
roles | json/xml content | list of strings | no | changed roles |
{ "user": { "login": "james", "password": "newpassword", "active": true, "roles": [ "user", "admin" ] } }
<?xml version="1.0" encoding="UTF-8"?> <user> <login>james</login> <password>newpassword</password> <active>true</active> <roles> <item>user</item> <item>admin</item> </roles> </user>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X PUT --data-binary @"new_user.json" "SERVER_ADDRESS:PORT/admin/user?login=james"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $LOGIN = "james"; //= user's login $user_data = array( 'user' => array ( 'login' => $LOGIN, 'password' => 'newpassword', 'active' => true, 'roles' => array ( 'user', ) ) ); $options = array( 'http' => array ( 'method' => 'PUT', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: application/json', 'content' => json_encode($user_data), 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/admin/user?login=$LOGIN", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
404Not Found |
|
Returns list of all users. Access to this method is allowed only for users with "admin" role.
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/admin/users?format=xml"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/admin/users", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AdminUsersResult", "users": [ { "login": "george", "active": true, "roles": [ "user", "admin" ] }, { "login": "john", "active": true, "roles": [ "user" ] } ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>AdminUsersResult</name> <users> <item> <login>george</login> <active>true</active> <roles> <item>user</item> <item>admin</item> </roles> </item> <item> <login>john</login> <active>true</active> <roles> <item>user</item> </roles> </item> </users> </result> |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
Returns list of all user roles. Access to this method is allowed only for users with "admin" role.
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/admin/roles"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/admin/roles", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "RolesResult", "roles": [ "admin", "user" ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>RolesResult</name> <roles> <item>admin</item> <item>user</item> </roles> </result> |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
For each technology returns total count of licenses, used licenses and hours to expire. Access to this method is allowed only for users with "admin" role.
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/admin/licenses"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/admin/licenses", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "LicensesResult", "licenses": [ { "technology_name": "Server", "technology_abbreviation": "SERVER", "model_name": "", "license": { "hours_to_expire": 6483, "n_licenses": 16, "n_used_licenses": 2 } }, { "technology_name": "Diarization", "technology_abbreviation": "DIAR", "model_name": "S", "license": { "hours_to_expire": 6483, "n_licenses": 16, "n_used_licenses": 2 } }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>LicensesResult</name> <licenses> <item> <technology_name>Server</technology_name> <technology_abbreviation>SERVER</technology_abbreviation> <model_name/> <license> <hours_to_expire>6483</hours_to_expire> <n_licenses>16</n_licenses> <n_used_licenses>2</n_used_licenses> </license> </item> <item> <technology_name>Diarization</technology_name> <technology_abbreviation>DIAR</technology_abbreviation> <model_name>S</model_name> <license> <hours_to_expire>6483</hours_to_expire> <n_licenses>16</n_licenses> <n_used_licenses>2</n_used_licenses> </license> </item> ... </licenses> </result> |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
Returns API documentation in HTML. This endpoint doesn't require authentication.
curl -X GET "SERVER_ADDRESS:PORT/doc"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $options = array( 'http' => array ( 'method' => 'GET', 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/doc", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | HTML document |
404Not Found |
|
Allows user to login with user's name and password. If user is successfully logged in, response contains session id. Given session id is necessary to use in other request headers (parameter X-SessionID). For more information, see Authentication chapter.
curl -u "LOGIN:PASSWORD" -X POST "SERVER_ADDRESS:PORT/login"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $ENCODE_CREDENTIALS = base64_encode("username:password"); $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'Authorization: Basic ' . $ENCODE_CREDENTIALS, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/login", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "UserSessionResult", "session": { "id": "258f505c-a6fa-4c3f-8a87-b048874ac6aa" } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>UserSessionResult</name> <session> <id>258f505c-a6fa-4c3f-8a87-b048874ac6aa</id> </session> </result> |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Returns the list of items in the directory.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Path to the server directory. |
show_unregistered | query | boolean | no | If true, output will contain unregistered files. Default value is false. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/directory?path=/DIRECTORY_PATH"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/"; //= path to the server directory $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/directory?path=$PATH", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 2, "name": "DirectoryResult", "list": [ { "name": "julia.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true }, { "name": "david.wav", "last_modified": "2015-08-03T11:32:41Z", "created": "2015-08-03T11:32:41Z", "size": 492204, "is_directory": false, "is_registered": true }, { "name": "test", "last_modified": "2015-07-29T14:20:38Z", "created": "2015-08-03T01:18:01Z", "size": 0, "is_directory": true, "is_registered": true } ] } } <?xml version="1.0"?> <result> <version>2</version> <name>DirectoryResult</name> <list> <item> <name>julia.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> </item> <item> <name>david.wav</name> <last_modified>2015-08-03T11:32:41Z</last_modified> <created>2015-08-03T11:32:41Z</created> <size>492204</size> <is_directory>false</is_directory> <is_registered>true</is_registered> </item> <item> <name>test</name> <last_modified>2015-07-29T14:20:38Z</last_modified> <created>2015-08-03T01:18:01Z</created> <size>0</size> <is_directory>true</is_directory> <is_registered>false</is_registered> </item> </list> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Create directory in current user's storage. All the required parent directories are created.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Path to the server directory. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/directory?path=/DIRECTORY_PATH"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/my_directory"; //= path to the server directory $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/directory?path=$PATH", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
Delete the directory from the current user's storage. All files and sub-directories will be deleted.
If results from technologies are in the cache, all results assigned to deleted files will be deleted, too.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Path to the server directory. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/directory?path=/DIRECTORY_PATH"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/my_directory"; //= path to the server directory $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/directory?path=$PATH", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Download audio file from server.
See also Usage examples - Audio file manipulation for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/audiofile?path=/AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= path to the audio file on the Phonexia Speech Engine $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/audiofile?path=$PATH", false, $context ); file_put_contents('./audio.wav', $response); //= audio file saved on the PHP server ?>
HTTP Status | Output |
---|---|
200OK | AUDIO DATA |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Upload audio file to the current user's storage. The request body contains audio file data.
If a file with the same name already exists on the server, it will be overwritten with uploaded file (if results from technologies are in the cache, all results assigned to overwritten file will be deleted).
By default server allows uploading files with unlimited size. This behavior can be changed in server configuration file by setting server.upload_max_filesize.
Server supports following encodings:
Audio converter always convert audio file to WAVE format and change file's extension to ".wav". Server checks if file has proper extension and is able to change it (for example uploaded OPUS audio file with requested name julia.ogg will be saved as julia.opus). If server change extension file and file with changed extension already exists, operation will be aborted and error with code 1039 will be returned.
See also Usage examples - Audio file manipulation for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file |
BINARY AUDIO DATA
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST --data-binary @"FILE_PATH" "SERVER_ADDRESS:PORT/audiofile?path=/AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= destination path to the audiofile on the Phonexia Speech Engine $audio = file_get_contents("./audio.wav"); //= path to the source file on the PHP server $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: audio/wav', 'content' => $audio, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/audiofile?path=$PATH", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioFileInfoResult", "info": { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioFileInfoResult</name> <info> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
413Request Entity Too Large |
|
415Unsupported Media Type |
|
Delete the audio file from current user's storage. If results from technologies are in the cache, all results assigned to deleted file will be deleted.
See also Usage examples - Audio file manipulation for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/audiofile?path=/AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= path to the audio file on the Phonexia Speech Engine $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/audiofile?path=$PATH", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Move or copy audio file.
This request supports extended possibility for path addressing. In path and new_path can be addressed file in storage, speaker model or calibration set. Paths addressing files in speaker model or calibration set have to start with symbol @. Speaker model or calibration will be created if necessary.
path=/my_directory/audio.wav
path=@speakerid/speakermodels/{SPEAKER_MODEL_NAME}/{RECORDING_NAME}or
path=@speakerid4/speakermodels/{SPEAKER_MODEL_NAME}/{RECORDING_NAME}Due to sharing speaker models between SID and SID4, both paths are equivalent.
path=@speakerid/calibsets/{CALIBRATION_SET_NAME}/{RECORDING_NAME}
See also Usage examples - Audio file manipulation for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Source audio file path. |
new_path | query | string | yes | Target audio file path. |
copy | query | string | no | When true, file is copied instead of moving. Default value is false. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X PUT "SERVER_ADDRESS:PORT/audiofile?path=/AUDIO_FILE.wav&new_path=/NEW/AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= path to the original audio file on the Phonexia Speech Engine $NEW_PATH = "/NEW/AUDIO_FILE.wav"; //= new path of audio file on the Phonexia Speech Engine $COPY = "false"; //= "true" for copying, "false" for moving $options = array( 'http' => array ( 'method' => 'PUT', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/audiofile?path=$PATH&new_path=$NEW_PATH©=$COPY", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioFileInfoResult", "info": { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioFileInfoResult</name> <info> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
415Unsupported Media Type |
|
Get audio file's meta-information
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/audiofile/metainfo?path=/AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= path to the audio file on the Phonexia Speech Engine $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create($options); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/audiofile/metainfo?path=$PATH", false, $context ); var_dump($response); ?>
HTTP Status | Output |
---|---|
200OK | META DATA |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Set meta-information to exist audio file in current user's storage. The request body contains custom data. If file already contains meta-information it will be overwritten with new meta-information
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file |
BINARY META DATA
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST --data-binary @"FILE_PATH" "SERVER_ADDRESS:PORT/audiofile/metainfo?path=/AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= destination path to the audiofile on the Phonexia Speech Engine $content = "custom meta data"; $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'content' => $content, 'ignore_errors' => true, ) ); $context = stream_context_create($options); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/audiofile/metainfo?path=$PATH", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
413Request Entity Too Large |
|
Delete meta-information of audio file from current user's storage.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/audiofile/metainfo?path=/AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= path to the audio file on the Phonexia Speech Engine $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/audiofile/metainfo?path=$PATH", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Returns information about audio file (such as frequency, length, number of channels)
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/audiofile/info?path=/AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= path to the audio file on the server $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/audiofile/info?path=$PATH", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioFileInfoResult", "info": { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioFileInfoResult</name> <info> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
415Unsupported Media Type |
|
This function registers file to system. It is useful if file wasn't uploaded via API (request POST /audiofile), for example file was copied to file system.
The file has to be in server storage folder (typically in {SERVER_PATH}/home/{USER_NAME}/storage).
By default server allows registering files with unlimited size. This behavior can be changed in server configuration file by setting server.upload_max_filesize.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Path to audio file on server. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/audiofile/registration?path=/AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= path to the audio file on the server $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/audiofile/registration?path=$PATH", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
404Not Found |
|
413Request Entity Too Large |
|
415Unsupported Media Type |
|
This function unregister file from system. All associated data are removed (results, meta information etc.), but file itself stays in filesystem.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/audiofile/registration?path=/AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= path to the audio file on the server $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/audiofile/registration?path=$PATH", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
Returns information about server load statistics.
task_queue_count | count of tasks currently waiting in queue |
task_queue_maximum | task queue size |
streamed_task_running | actual count of tasks processing stream |
streamed_task_maximum | maximum of simultaneous tasks processing stream |
worker_running | actual count of used workers |
worker_count | count of initialized workers |
http_input_stream_running | actual count of opened input HTTP streams |
websocket_input_stream_running | actual count of opened input WebSocket streams |
rtp_input_stream_running | actual count of opened input RTP streams |
rtp_input_stream_maximum | maximum count of opened input RTP streams |
rtp_output_stream_running | actual count of opened output RTP streams |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/loadstatistics"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/loadstatistics", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 4, "name": "LoadStatisticResult", "load_statistics": { "task_queue_count": 0, "task_queue_maximum": 1000, "streamed_task_running": 0, "streamed_task_maximum": 5, "worker_running": 1, "worker_count": 10, "http_input_stream_running": 0, "websocket_input_stream_running": 0, "rtp_input_stream_running": 0, "rtp_input_stream_maximum": 10, "rtp_output_stream_running": 1 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>4</version> <name>LoadStatisticResult</name> <load_statistics> <task_queue_count>0</task_queue_count> <task_queue_maximum>1000</task_queue_maximum> <streamed_task_running>0</streamed_task_running> <streamed_task_maximum>5</streamed_task_maximum> <worker_running>1</worker_running> <worker_count>10</worker_count> <http_input_stream_running>0</http_input_stream_running> <websocket_input_stream_running>0</websocket_input_stream_running> <rtp_input_stream_running>0</rtp_input_stream_running> <rtp_input_stream_maximum>10</rtp_input_stream_maximum> <rtp_output_stream_running>1</rtp_output_stream_running> </load_statistics> </result> |
400Bad Request |
|
401Unauthorized |
|
Returns information about asynchronous request with the specified asynchronous request id. When operation is done, 303 returns status is used and HTTP header contains address for final result in "Location" parameter. For more information about asynchronous requests, see Asynchronous request.
This request can be used for opening WebSocket. In this case header of request should contain WebSocket handshake parameters (Upgrade, Connection, Sec-WebSocket-Version, Sec-WebSocket-Key). Header must also contain session parameter (X-SessionID) or basic authorization (Authorization). Supported Sec-WebSocket-Version is 13. When asynchronous operation finishes, result is sent through WebSocket's message and WebSocket is closed. Only one WebSocket can be opened for one asynchronous operation.
Example header for create WebSocket:
GET /pending/ec563083-3d9b-457d-a0ac-24b197bc222f HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw== Sec-WebSocket-Version: 13 X-SessionID: 258f505c-a6fa-4c3f-8a87-b048874ac6aa Accept: application/json
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
id | path | string | yes | Determines the asynchronous request ID. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/pending/ASYNCHRONOUS_REQUEST_ID"
/* See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example */
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 2, "name": "PendingInfoResult", "info": { "id": "ec563083-3d9b-457d-a0ac-24b197bc222f", "state": "waiting", "priority": 50 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>PendingInfoResult</name> <info> <id>a869ea70-980a-4497-99b4-3ef181f0b87d</id> <state>waiting</state> <priority>50</priority> </info> </result> |
303See Other | JSONXML{ "result": { "version": 2, "name": "PendingInfoResult", "info": { "id": "ec563083-3d9b-457d-a0ac-24b197bc222f", "state": "finished", "priority": 50 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>PendingInfoResult</name> <info> <id>ec563083-3d9b-457d-a0ac-24b197bc222f</id> <state>finished</state> <priority>50</priority> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Remove asynchronous request with the specified asynchronous request id. Requests can be removed only while they are in waiting state, i.e. while they are still waiting in a queue for being processed. Once the task processing starts, i.e. the task gets into running state, the processing cannot be cancelled and the task is always processed. See also Asynchronous request for more details about task states.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
id | path | string | yes | Determines the asynchronous request ID. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/pending/ASYNCHRONOUS_REQUEST_ID"
/* See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example */
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Returns result of asynchronous request with the specified asynchronous request id. For more information about asynchronous requests, see Asynchronous request.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
id | path | string | yes | Determines the asynchronous request ID. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/done/ASYNCHRONOUS_REQUEST_ID"
/* See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example */
HTTP Status | Output |
---|---|
200OK | Variable output Contains response of done asynchronous request. For example, this response will contain VoiceActivityDetectionResult after processing GET /technologies/vad. See response output of specific asynchronous request for more details. |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Return information about all registered tasks. Finished tasks are removed after a client pick it up or after timeout period.
This request does not require user authentication.
curl -X GET "SERVER_ADDRESS:PORT/tasks"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $options = array( 'http' => array ( 'method' => 'GET', 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/tasks", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 2, "name": "TasksResult", "tasks": [ { "id": "964b2969-396c-4e1c-b139-0ee1024bbab1", "state": "running", "priority": 50 }, { "id": "857d3674-045c-5a7b-b248-5ca9644dfab1", "state": "finished", "priority": 27 }, ... ] } } <?xml version='1.0' encoding='UTF-8'?> <result> <version>2</version> <name>TasksResult</name> <tasks> <item> <id>964b2969-396c-4e1c-b139-0ee1024bbab1</id> <state>running</state> <priority>50</priority> </item> <item> <id>857d3674-045c-5a7b-b248-5ca9644dfab1</id> <state>finished</state> <priority>27</priority> </item> </tasks> </result> |
400Bad Request |
|
List currently running technologies and returns a list of their respective models.
If the show_all parameter is set to true all available technologies will be listed.
This request does not require user authentication.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
show_all | query | boolean | no | If true, the output will include disabled models (these models will have n_total_instances equal to zero). Default value is false. |
curl -X GET "SERVER_ADDRESS:PORT/technologies"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $options = array( 'http' => array ( 'method' => 'GET', 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 4, "name": "TechnologiesResult", "technologies": [ { "name": "Age Estimation", "abbreviation": "AGE", "is_capacity_exceeded": false, "models": [ { "name": "S", "version": "1.2.1", "n_total_instancies": 3, "n_busy_instancies": 0 } ] }, { "name": "Diarization", "abbreviation": "DIAR", "is_capacity_exceeded": true, "models": [ { "name": "L", "version": "1.0.2", "n_total_instancies": 3, "n_busy_instancies": 0 } ] }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>4</version> <name>TechnologiesResult</name> <technologies> <item> <name>Age Estimation</name> <abbreviation>AGE</abbreviation> <is_capacity_exceeded>false</is_capacity_exceeded> <models> <item> <name>S</name> <version>1.2.1</version> <n_total_instancies>3</n_total_instancies> <n_busy_instancies>0</n_busy_instancies> </item> </models> </item> <item> <name>Diarization</name> <abbreviation>DIAR</abbreviation> <is_capacity_exceeded>true</is_capacity_exceeded> <models> <item> <name>L</name> <version>1.0.2</version> <n_total_instancies>3</n_total_instancies> <n_busy_instancies>0</n_busy_instancies> </item> </models> </item> ... </technologies> </result> |
400Bad Request |
|
400Bad Request |
|
This endpoint is used to configure technologies and their models running on the server.
Only users with the admin role can access this endpoint.
Changes made through this endpoint require a server restart to take effect (use POST /server/restart endpoint).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content. |
{ "technologies": [ { "abbreviation": "VAD", "models": [ { "name": "GENERIC_3", "n_total_instancies": 3 }, { "name": "GENERIC", "n_total_instancies": 1 } ] }, { "abbreviation": "GID", "models": [ { "name": "XL5", "n_total_instancies": 3 } ] } ] }
<?xml version="1.0" encoding="UTF-8"?> <technologies> <item> <abbreviation>VAD</abbreviation> <models> <item> <name>GENERIC_3</name> <n_total_instancies>3</n_total_instancies> </item> <item> <name>GENERIC</name> <n_total_instancies>1</n_total_instancies> </item> </models> </item> <item> <abbreviation>GID</abbreviation> <models> <item> <name>XL5</name> <n_total_instancies>3</n_total_instancies> </item> </models> </item> </technologies>
technologies[]->abbreviation | Abbreviation of the technology. Server will validate if technology is present on the server. |
---|---|
technologies[]->models[]->name | Name of the model. Server will validate if this name is a valid model name for the associated technology. |
technologies[]->models[]->n_total_instancies | Number of instances of this model to run. Must be greater than 0. |
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary @"technologies.json" "SERVER_ADDRESS:PORT/technologies"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $user_data = array( 'technologies' => array ( (object) [ 'abbreviation' => 'VAD', 'models' => array ( (object) [ 'name' => 'GENERIC_3', 'n_total_instancies' => 3 ], (object) [ 'name' => 'GENERIC', 'n_total_instancies' => 1 ] ) ], (object) [ 'abbreviation' => 'gid', 'models' => array ( (object) [ 'name' => 'XL5', 'n_total_instancies' => 3 ] ) ] ) ); $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: application/json', 'content' => json_encode($user_data), 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
Returns information about current user.
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/user"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/user", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "UserResult", "user": { "login": "james", "active": true, "roles": [ "user", "admin" ] } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>UserResult</name> <user> <login>james</login> <active>true</active> <roles> <item>user</item> <item>admin</item> </roles> </user> </result> |
400Bad Request |
|
401Unauthorized |
|
Allows changing user password.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content. |
password | json/xml content | string | yes | changed password |
{ "user": { "password": "newpassword" } }
<?xml version="1.0" encoding="UTF-8"?> <user> <password>newpassword</password> </user>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X PUT --data-binary @"user_changes.json" "SERVER_ADDRESS:PORT/user"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $LOGIN = "james"; //= user's login $user_data = array( 'user_changes' => array ( 'password' => 'newpassword' ) ); $options = array( 'http' => array ( 'method' => 'PUT', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: application/json', 'content' => json_encode($user_data), 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/user", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Returns server status. This method does not require user authentication.
curl -X GET "SERVER_ADDRESS:PORT/status"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $options = array( 'http' => array ( 'method' => 'GET', 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/status", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 2, "name": "StatusResult", "database": "ok", "licenses": "ok", "internal_services": "ok", "reporting_service": "ok" } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>StatusResult</name> <database>ok</database> <licenses>ok</licenses> <internal_services>ok</internal_services> <reporting_service>ok</reporting_service> </result> |
500Internal Server Error | JSONXML{ "result": { "version": 2, "name": "StatusResult", "database": "failed", "licenses": "failed", "internal_services": "failed", "reporting_service": "failed" } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>StatusResult</name> <database>failed</database> <licenses>failed</licenses> <internal_services>failed</internal_services> <reporting_service>failed</reporting_service> </result> |
Returns information about the server
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/server/info"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/server/info", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 6, "name": "ServerInfoResult", "info": { "version": "3.30.1", "build_number": "1597", "bsapi_version": "Phonexia s.r.o., build Apr 9 2020, 14:30:51, v3.30.1", "audio_converter_enabled": true, "maximum_upload_file_size": 0, "maximum_upload_meta_file_size": 0, "rtp_streams_enabled": true, "http_streams_enabled": true, "websocket_streams_enabled": true, "task_priorities_enabled": true, "default_task_priority": 50 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>6</version> <name>ServerInfoResult</name> <info> <version>3.30.1</version> <build_number>1597</build_number> <bsapi_version>Phonexia s.r.o., build Apr 9 2020, 14:30:51, v3.30.1</bsapi_version> <audio_converter_enabled>true</audio_converter_enabled> <maximum_upload_file_size>0</maximum_upload_file_size> <maximum_upload_meta_file_size>0</maximum_upload_meta_file_size> <rtp_streams_enabled>true</rtp_streams_enabled> <http_streams_enabled>true</http_streams_enabled> <websocket_streams_enabled>true</websocket_streams_enabled> <task_priorities_enabled>true</task_priorities_enabled> <default_task_priority>50</default_task_priority> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
Restarts the server. Only users with the admin role can access this endpoint.
This request will fail if a task is running on the server.
Use GET /tasks to get information about running tasks.
Note: While the server is restarting, any request to the server will fail.
Use e.g. GET /status and/or GET /server/info to check the server readiness.
Caution: If some configuration has been inappropriately changed before restarting, the server may fail to start.
Note 2: Not recommended to use when Speech Engine is running on Windows as a service. Restarting the server this way creates a completely new process on Windows, out of the service context, and therefore cannot be managed as a service anymore (i.e. does not respond to stopping/restarting the service).
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/server/restart"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/server/restart", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
Shuts down the server. Only users with the admin role can access this endpoint.
This request will fail if a task is running on the server.
Use GET /tasks to get information about running tasks.
Caution: Use wisely, as you may not be able to start the server again (especially with remote servers).
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/server/shutdown"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/server/shutdown", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
Opens input RTP stream. Stream is opened on port, which is returned in result.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | no | Path to file where streamed data will be saved. If path is not set file will not be saved. File will be overwritten if already exists. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/input_stream/rtp"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "RtpInputStreamResult", "port": "5000", "input_stream": "ec563083-3d9b-457d-a0ac-24b197bc222f" } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>RtpInputStreamResult</name> <port>5000</port> <input_stream>a869ea70-980a-4497-99b4-3ef181f0b87d</input_stream> </result> |
400Bad Request |
|
403Forbidden |
|
405Method Not Allowed |
|
Closes opened input RTP stream.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
input_stream | query | string | yes | ID of opened input RTP stream. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/input_stream/rtp?input_stream=OPENED_RTP_STREAM"
HTTP Status | Output | ||||||||
---|---|---|---|---|---|---|---|---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "RtpInputStreamDeleteResult", "number_of_received_packets": "100", "number_of_lost_packets": "1", "packet_loss": "1.0", "jitter": "10.24" } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>RtpInputStreamDeleteResult</name> <number_of_received_packets>100</number_of_received_packets> <number_of_lost_packets>1</number_of_lost_packets> <packet_loss>1.0</packet_loss> <jitter>10.24</jitter> </result> Result description
| ||||||||
400Bad Request |
| ||||||||
404Not Found |
| ||||||||
405Method Not Allowed |
|
Return information about the input RTP stream such as source address, target address, and transfer statistics.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
input_stream | query | string | yes | ID of opened input RTP stream. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/input_stream/rtp/info?input_stream=OPENED_RTP_STREAM"
HTTP Status | Output | ||||||||
---|---|---|---|---|---|---|---|---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "RtpInputStreamInfoResult", "source_address": { "ip": "127.0.0.1", "port": 54271 }, "target_address": { "ip": "0.0.0.0", "port": 10001 }, "statistics": { "number_of_received_packets": 631, "number_of_lost_packets": 0, "packet_loss": 0, "jitter": 3.0381560121013047 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>RtpInputStreamInfoResult</name> <source_address> <ip>127.0.0.1</ip> <port>58281</port> </source_address> <target_address> <ip>0.0.0.0</ip> <port>10001</port> </target_address> <statistics> <number_of_received_packets>353</number_of_received_packets> <number_of_lost_packets>0</number_of_lost_packets> <packet_loss>0</packet_loss> <jitter>3.0308383114718813</jitter> </statistics> </result> Statistics description
| ||||||||
400Bad Request |
| ||||||||
404Not Found |
| ||||||||
405Method Not Allowed |
|
Opens input HTTP stream.
See also Usage examples - Speech To Text Stream for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
frequency | query | string | no | Frequency of streamed data. Default value is 8000. |
n_channels | query | string | no | Number of channels. Default value is 1. |
path | query | string | no | Path to file where streamed data will be saved. If path is not set file will not be saved. File will be overwritten if already exists. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/input_stream/http?frequency=8000"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "HttpInputStreamResult", "input_stream": "ec563083-3d9b-457d-a0ac-24b197bc222f" } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>HttpInputStreamResult</name> <input_stream>a869ea70-980a-4497-99b4-3ef181f0b87d</input_stream> </result> |
400Bad Request |
|
405Method Not Allowed |
|
Sends data to input stream via HTTP request. Chunked HTTP stream is supported as well.
See also Usage examples - Speech To Text Stream for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
input_stream | query | string | yes | ID of opened input HTTP stream. |
RAW AUDIO DATA (s16le, frequency and number of channels depends on request POST /input_stream/http?frequency={FREQ}&n_channels={N})
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
404Not Found |
|
405Method Not Allowed |
|
Closes opened input HTTP stream.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
input_stream | query | string | yes | ID of opened HTTP stream. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/input_stream/http?input_stream=OPENED_HTTP_STREAM"
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
404Not Found |
|
405Method Not Allowed |
|
Opens input WebSocket stream.
WebSocket handshake request must contains the following parameters in the header: Upgrade, Connection, Sec-WebSocket-Version, Sec-WebSocket-Key and session parameter (X-SessionID) or basic authorization (Authorization).GET /input_stream/websocket?frequency=8000&n_channels=1 HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw== Sec-WebSocket-Version: 13 X-SessionID: 258f505c-a6fa-4c3f-8a87-b048874ac6aa Accept: application/json
Ther result of this request is delivered via WebSocket as a first frame. Data must be sent in a binary format in s16le format. If an error occurs during the upgrading connection, the error is delivered as an HTTP response. If an error occurs after a WebSocket connection is established, the WebSocket is closed with the corresponding WebSocket's status code. The maximum frame size is 4 MiB by default. When the WebSocket connection is closed, the input stream stops automatically. This can be changed in the server configuration file using the input_stream.websocket.max_payload_size option.
See also Usage examples - Speech To Text Stream for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
frequency | query | string | no | Frequency of streamed data. Default value is 8000. |
n_channels | query | string | no | Number of channels. Default value is 1. |
path | query | string | no | Path to file where streamed data will be saved. If path is not set file will not be saved. File will be overwritten if already exists. |
HTTP Status | Output |
---|---|
WebSocket | JSONXML{ "result": { "version": 1, "name": "WebSocketInputStreamResult", "input_stream": "ec563083-3d9b-457d-a0ac-24b197bc222f" } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>WebSocketInputStreamResult</name> <input_stream>a869ea70-980a-4497-99b4-3ef181f0b87d</input_stream> </result> |
400Bad Request |
|
405Method Not Allowed |
|
Lists status of opened output RTP streams for a user. If the user has admin role, all of the opened output RTP streams are listed.
Note that output RTP streams are automatically deleted after the timeout specified in SPE property file. This timeout fires when no task is attached to the output stream, or the attached task is already finished for a given amount of time.
See also Usage examples - External Text To Speech stream for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
output_stream | query | string | yes | ID of opened output RTP stream. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/output_stream/rtp?output_stream=OPENED_RTP_STREAM"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "RtpOutputStreamsListResult", "user_output_streams": [ { "user": "admin", "output_streams": ["tc548623-3d9b-445d-a8ac-24b17bc222fa", "35cb19b9-9a1e-430f-89a4-2eb33c8a1337"] }, { "user": "john", "output_streams": ["32ee0cf9-c7a4-4999-a321-241e668db831"] } ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>RtpOutputStreamsListResult</name> <user_output_streams> <item> <user>admin</user> <output_streams> <item>tc548623-3d9b-445d-a8ac-24b17bc222fa</item> <item>35cb19b9-9a1e-430f-89a4-2eb33c8a1337</item> </output_streams> </item> <item> <user>john</user> <output_streams> <item>32ee0cf9-c7a4-4999-a321-241e668db831</item> </output_streams> </item> </user_output_streams> </result> |
405Method Not Allowed |
|
Opens output RTP stream. Opened stream sends data to host address and port specified. In specified RTP payloadType.
Note that output RTP streams are automatically deleted after the timeout specified in SPE property file. This timeout fires when no task is attached to the output stream, or the attached task is already finished for a given amount of time.
See also Usage examples - External Text To Speech stream for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
host | query | string | yes | Host in format address:port. E.g. myserver.com:6789 |
payload_type | query | number | yes | Payload type. Supported payloads are 0 (PCMU) and 8 (PCMA). See RTP/HTTP streams for more information. |
source_port | query | number | no | Source port. When omitted, the source port is automatically assigned. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/output_stream/rtp?host=127.0.0.1:6789&payload_type=0"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "RtpOutputStreamResult", "output_stream": "tc548623-3d9b-445d-a8ac-24b17bc222f" } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>RtpOutputStreamResult</name> <output_stream>tc548623-3d9b-445d-a8ac-24b17bc222f</output_stream> </result> |
400Bad Request |
|
405Method Not Allowed |
|
Closes opened output RTP stream.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
output_stream | query | string | yes | ID of opened output RTP stream. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/output_stream/rtp?output_stream=OPENED_RTP_STREAM"
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
404Not Found |
|
405Method Not Allowed |
|
This endpoint is deprecated since SPE 3.23.x. Use POST /input_stream/rtp instead.
Opens RTP stream for listening. Stream is opened on port, which is returned in result.Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | no | Path to file where streamed data will be saved. If path is not set file will not be saved. File will be overwritten if already exists. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/stream/rtp"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "RtpStreamResult", "port": "5000", "stream": "ec563083-3d9b-457d-a0ac-24b197bc222f" } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>RtpStreamResult</name> <port>5000</port> <stream>a869ea70-980a-4497-99b4-3ef181f0b87d</stream> </result> |
400Bad Request |
|
403Forbidden |
|
405Method Not Allowed |
|
This endpoint is deprecated since SPE 3.23.x. Use DELETE /input_stream/rtp instead.
Closes opened RTP stream.Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
stream | query | string | yes | ID of opened RTP stream. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/stream/rtp?stream=OPENED_RTP_STREAM"
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
404Not Found |
|
405Method Not Allowed |
|
This endpoint is deprecated since SPE 3.23.x. Use POST /input_stream/http instead.
Opens HTTP stream for listening.Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
frequency | query | string | no | Frequency of streamed data. Default value is 8000. |
n_channels | query | string | no | Number of channels. Default value is 1. |
path | query | string | no | Path to file where streamed data will be saved. If path is not set file will not be saved. File will be overwritten if already exists. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/stream/http?frequency=8000"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "HttpStreamResult", "stream": "ec563083-3d9b-457d-a0ac-24b197bc222f" } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>HttpStreamResult</name> <stream>a869ea70-980a-4497-99b4-3ef181f0b87d</stream> </result> |
400Bad Request |
|
405Method Not Allowed |
|
This endpoint is deprecated since SPE 3.23.x. Use PUT /input_stream/http instead.
Sends data to stream via HTTP request. Chunked HTTP stream is supported as well.Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
stream | query | string | yes | ID of opened HTTP stream. |
RAW AUDIO DATA (s16le, frequency and number of channels depends on request POST /stream/http?frequency={FREQ}&n_channels={N})
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
404Not Found |
|
405Method Not Allowed |
|
This endpoint is deprecated since SPE 3.23.x. Use DELETE /input_stream/http instead.
Closes opened HTTP stream.Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
stream | query | string | yes | ID of opened HTTP stream. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/stream/http?stream=OPENED_HTTP_STREAM"
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
404Not Found |
|
405Method Not Allowed |
|
Concatenate two audio files with the same number of channels and the same frequency. Output file is always WAV. Function concatenate channels on channel level, so that target wav file will have the same number of channels as first file.
channel 1 |
channel 2 |
channel 1 |
channel 2 |
channel 1 | channel 1 |
channel 2 | channel 2 |
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path1 | query | string | yes | Server path to first audio file. |
path2 | query | string | yes | Server path to second audio file. |
target | query | string | yes | Server path where will be stored new audio file. Extension .wav is automatically added. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/utils/audiofile/concatenate?path1=/julia.wav&path2=/john.wav&target=/julia_john.wav"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/utils/audiofile/concatenate', uri_params: { path1: '/julia.wav', path2: '/john.wav', target: '/julia_john.wav' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioFileInfoResult", "info": { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioFileInfoResult</name> <info> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
415Unsupported Media Type |
|
Create new file which will contain data determined by segmentation. Input time values are in 100ns units (value 10000000 is 1sec). Output file is always WAV.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content |
path | query | string | yes | Server path to the audio file. |
keep_original_length | query | boolean | no | If set to true, the new file will keep original length of audio file. Default false. |
target | query | string | yes | Server path where will be stored new audio file. Extension .wav is automatically added. |
{ "cut_segments": [ { "start": 0, "end": 10000000 }, { "start": 20000000, "end": 100000000 } ... ] }
<cut_segments> <item> <start>0</start> <end>1000000</end> </item> <item> <start>2000000</start> <end>10000000</end> </item> ... </cut_segments>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary @"segmentation.json" "SERVER_ADDRESS:PORT/utils/audiofile/cut?path=/julia.wav&target=/julia_cut.wav"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var segments = { "cut_segments": [ { "start": 0, "end": 10000000 }, { "start": 20000000, "end": 100000000 } ] }; var options = { method: 'POST', content: segments, uri_path: '/utils/audiofile/cut', uri_params: { path: '/julia.wav', target: '/julia_cut.wav' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioFileInfoResult", "info": { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioFileInfoResult</name> <info> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Merge two audio files to new one. First are stored channels from first source file, then channels from second source file. Frequency of both files has to be identical. Output file is always WAV.
channel 1 |
channel 2 |
channel 1 |
channel 2 |
channel 1 | |
channel 2 | |
channel 3 | silent |
channel 4 | silent |
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path1 | query | string | yes | Server path to first audio file. |
path2 | query | string | yes | Server path to second audio file. |
target | query | string | yes | Server path where will be stored new audio file. Extension .wav is automatically added. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/utils/audiofile/merge?path1=/julia.wav&path2=/john.wav&target=/julia_john.wav"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/utils/audiofile/merge', uri_params: { path1: '/julia.wav', path2: '/john.wav', target: '/julia_john.wav' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioFileInfoResult", "info": { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioFileInfoResult</name> <info> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
415Unsupported Media Type |
|
Take audio file from parameter path and split its channels to separate files. Names will be generated by adding "_X.wav" to target parameter. X represent channel number.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file to be splitted. |
target | query | string | yes | Server path which will be used as base for new files. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/utils/audiofile/split?path=/julia.wav&target=/julia/channel"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/utils/audiofile/split', uri_params: { path: '/julia.wav', target: '/julia/channel' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 2, "name": "AudioFileMultiInfoResult", "info": [ { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } ... ] } } <?xml version="1.0"?> <result> <version>2</version> <name>AudioFileMultiInfoResult</name> <info> <item> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </item> ... </info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Get status of audio file playback for player identified by player ID. Playback time and total length values of result are in seconds (floating point numbers).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Task ID of player for which the playback status should be retreived |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/utils/player/output_stream?task=PLAYER_TASK_ID"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "PlayerOutputStreamTaskInfoResult", "task_id": "8asd2f1c-a78d-42f6-56sa-casd5f4d8s6a", "playback_position": 10.1, "total_length": 55.368 } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>PlayerOutputStreamTaskInfoResult</name> <task_id>8asd2f1c-a78d-42f6-56sa-casd5f4d8s6a</task_id> <playback_position>10.1</playback_position> <total_length>55.368</total_length> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Start task playing audio file into specified output stream
Only mono audio files can be played. If needed, use /utils/audiofile/split to obtain channels separately.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Path to audio file which should be played. |
output_stream | query | string | yes | Output stream ID where audio file data should be sent. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/utils/player/output_stream?path=AUDIO_FILE&output_stream=OUTPUT_STREAM_ID"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "UserOutputStreamTaskInfoResult", "stream_task_info": { "id": "8506180c-e87d-42f6-ac9a-c5ca3a3a3202", "state": "running", "output_stream_id": "29eae856-0004-46a2-a761-9e9a72bad719" } } } <result> <version>1</version> <name>UserOutputStreamTaskInfoResult</name> <stream_task_info> <id>8506180c-e87d-42f6-ac9a-c5ca3a3a3202</id> <state>running</state> <output_stream_id>29eae856-0004-46a2-a761-9e9a72bad719</output_stream_id> </stream_task_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Stop task playing the audio file into output stream.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Task ID of player which should be stopped. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/utils/player/output_stream?task=PLAYER_TASK_ID"
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Returns estimated age of speaker in record. This request is asynchronous (see Asynchronous request).
See also Usage examples - Age Estimation for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file |
model | query | string | yes | Name of age estimation model |
cache_only | query | boolean | no | If true, cache_only ensures that the result is returned only if it is already in the cache (the result is stored in the cache if the file has already been processed by the technology). If the result isn't in cache yet, only 404 status is returned. This parameter is not mandatory and if it is not set by the user, the recording is processed by the given technology automatically if the result is not already in the cache. Parameters cache_only and cache_disable can not be used together. |
cache_disable | query | boolean | no | If true, the result cache is disabled. cache_disable ensures that the recording is always processed and the result is not stored in the cache. Parameters cache_only and cache_disable can not be used together. |
from_time | query | double | no | from_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed from the beginning. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
to_time | query | double | no | to_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed to the end. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/agestim?path=/julia.wav&model=S"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/agestim', uri_params: { path: '/julia.wav', model: 'S' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
200OK | The time_range parameter in the output is serialized only when query parameters from_time or to_time are specified. JSONXML{ "result": { "version": 2, "name": "AgeEstimationResult", "file": "julia_1.wav", "model": "L", "time_range": { "from_time": 2.5, "to_time": 5.5 }, "channel_scores": [ { "channel": 0, "scores": [ { "name": "0", "score": 0 }, { "name": "1", "score": 0 }, ... ] } ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>AgeEstimationResult</name> <file>julia_1.wav</file> <model>L</model> <time_range> <from_time>2.5</from_time> <to_time>5.5</to_time> </time_range> <channel_scores> <item> <channel>0</channel> <scores> <item> <name>0</name> <score>0</score> </item> <item> <name>1</name> <score>0</score> </item> ... </scores> </item> </channel_scores> </result> Scores object description
| ||||||||||
400Bad Request |
| ||||||||||
401Unauthorized |
| ||||||||||
404Not Found |
| ||||||||||
405Method Not Allowed |
| ||||||||||
406Not Acceptable |
| ||||||||||
415Unsupported Media Type |
|
Returns estimated age of speaker in SID voiceprint. Use request GET /technologies/speakerid/extractvp to extract voiceprint from recording. It is necessary to use same name of AGE model as name of SID model used for voiceprint extraction (for example: voiceprint extracted with model XL3 must be processed only with AGE model XL3) otherwise server returns http error 500.
This request is asynchronous (see Asynchronous request).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of age estimation model. Use the same model name as used during the voiceprint extraction. |
Content-Type | header | string | yes | application/json for JSON content (Default value) application/xml for XML content application/octet-stream for raw voiceprint content |
{ "voiceprint": "<Base64 Data>" }
<?xml version="1.0" encoding="UTF-8"?> <voiceprint>[Base64 Data]</voiceprint>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary @"voiceprint.json" "SERVER_ADDRESS:PORT/technologies/agestim?model=S"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/technologies/agestim', uri_params: { model: 'S' }, content: { "voiceprint": "VlBUIAYA//+pCQAAWAIAAAAAAABwMEofIAAAAKkJAABYAgAAAAAAAAA8HEYAPBxGAAAAAAYAAADL9Xw/UcsevyAbFD/iCuA/tmphP/TqzT8Sjx+/48ocPyme/D/RcrA+JNspP9c+iT+xBog+sEcuwAhV77/2f4+/DHG/PxnnCr8bYi++i6HEvrrOGr9zdLK+nUqTP7+ZGT4asAA/KDGNva4ynjxhphtAYmVFwCoxkL9ba+u+lbajPmc9wr/SzQ1AftyevwQoOz8o6Ya+9JCLP7mRyr8ZIlW/bQDnPZeXmr8RwhDA7VaSv6VfwT1YUcS/EqGMP92z2D/Rz4E/QktnP7ZrVD9rfpO+XapPvjbyCD8aabI+bcFUv7ho2r2ARg28eIilv0KYVb+0x8e+H0rdv613tj/5pay+4vpUvgAdcbu7H5A/0U/cPwV4E79AGmU/W1gUv8w5KsCcDDQ/vpBQPu1mhL9BBVQ/FecMvgxJq76e9ms9WJWPP2jZKL+WHfG+zuk9PrPQMz6cSxk/tc6nP5eREb8YIiU+NY8xP6M2mr8IIKq/qPWVPyl+3T8eNdI/0U6qv0N4+j+S9qU/KogNv3R7AsB+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EnPLcgcz0uCq283QyIPRE7kbq0O/U6JGmSPD8Ke7rVceO8zn0/PRy6WT1FBBU9XpsmPVOUK71dU9y8i0VvPS9Wgj2LAIE8ThOePBvAl7wUFTK8WCRcvRrYo7kNfa89eS4IvdF9wDy6Sdq73ADmvSU8+boFOFE8ao6fvbQVHr39zi09mqJVO1lcTr2ZCFO9Ae2DvTVpX73zufK8ES6nutk3vzwIWUw9GYGcPVIfOr1Rv0Y9QT0ZvXb3Dz25w4i7TePvvL4t97uqna889sOsvO5iQb1cWJ09vXwRvbSuAL4=" }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
200OK | JSONXML{ "result": { "version": 2, "name": "AgeEstimationResult", "file": "{voiceprint}", "model": "L", "channel_scores": [ { "channel": 0, "scores": [ { "name": "0", "score": 0 }, { "name": "1", "score": 0 }, ... ] } ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>AgeEstimationResult</name> <file>{voiceprint}</file> <model>L</model> <channel_scores> <item> <channel>0</channel> <scores> <item> <name>0</name> <score>0</score> </item> <item> <name>1</name> <score>0</score> </item> ... </scores> </item> </channel_scores> </result> Scores object description
| ||||||||||
400Bad Request |
| ||||||||||
401Unauthorized |
| ||||||||||
405Method Not Allowed |
|
Benchmark of Age Estimation technology with default set of recordings or specified recording (by parameter path).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of Age Estimation technology model. |
path | query | string | no | Server path to the audio file. If not specified, default recordings will be used. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/agestim/benchmark?model=S"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/agestim/benchmark', uri_params: { model: 'S' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AgeEstimBenchmarkResult", "dataset_version": "1.0", "model_name": "S", "benchmark_result": { "processed_length": 21.31999969482422, "processing_time": 0.502251, "faster_than_realtime": 42.448894466759086 }, "cpu_info": { "vendor": "GenuineIntel", "brand": "Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz", "n_cores": 4, "n_logical_cores": 4, "l1_data_cache": 32768, "l1_instruction_cache": 32768, "l2_cache": 262144, "l3_cache": 6291456 }, "memory_info": { "total_ram": 16623747072, "free_ram": 5028855808, "total_swap": 0, "free_swap": 0 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>AgeEstimBenchmarkResult</name> <dataset_version>1.0</dataset_version> <model_name>S</model_name> <benchmark_result> <processed_length>21.31999969482422</processed_length> <processing_time>0.502251</processing_time> <faster_than_realtime>42.448894466759086</faster_than_realtime> </benchmark_result> <cpu_info> <vendor>GenuineIntel</vendor> <brand>Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz</brand> <n_cores>4</n_cores> <n_logical_cores>4</n_logical_cores> <l1_data_cache>32768</l1_data_cache> <l1_instruction_cache>32768</l1_instruction_cache> <l2_cache>262144</l2_cache> <l3_cache>6291456</l3_cache> </cpu_info> <memory_info> <total_ram>16623747072</total_ram> <free_ram>4938498048</free_ram> <total_swap>0</total_swap> <free_swap>0</free_swap> </memory_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Create denoised recording from source recording.
Output audio file is always WAV. If file specified by parameter target has no extension or extension is other than .wav, then extension .wav is appended.
This request is asynchronous (see Asynchronous request).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to source audio file |
target | query | string | yes | Server path to target audio file |
model | query | string | yes | Name of Denoiser model |
from_time | query | double | no | from_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed from the beginning. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
to_time | query | double | no | to_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed to the end. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/technologies/denoiser?path=julia_1.wav&target=julia_1_denoised.wav&model=EN_US"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/technologies/denoiser', uri_params: { path: '/julia_1.wav', target: '/julia_1_denoised.wav', model: 'EN_US' }, callback: function(result) { console.log(result); // work with result } };
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioFileInfoResult", "info": { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioFileInfoResult</name> <info> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
406Not Acceptable |
|
Benchmark of Denoiser technology with default set of recordings or specified recording (by parameter path).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of Denoiser technology model. |
path | query | string | no | Server path to the audio file. If not specified, default recordings will be used. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/denoiser/benchmark?model=EN_US"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/denoiser/benchmark', uri_params: { model: 'EN_US' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "DenoiserBenchmarkResult", "dataset_version": "1.0", "model_name": "EN_US", "benchmark_result": { "processed_length": 901.930118560791, "processing_time": 191.034012, "faster_than_realtime": 8.379610791963618 }, "cpu_info": { "vendor": "GenuineIntel", "brand": "Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz", "n_cores": 4, "n_logical_cores": 4, "l1_data_cache": 32768, "l1_instruction_cache": 32768, "l2_cache": 262144, "l3_cache": 6291456 }, "memory_info": { "total_ram": 16623747072, "free_ram": 5028855808, "total_swap": 0, "free_swap": 0 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>DenoiserBenchmarkResult</name> <dataset_version>1.0</dataset_version> <model_name>EN_US</model_name> <benchmark_result> <processed_length>901.930118560791</processed_length> <processing_time>191.034012</processing_time> <faster_than_realtime>8.379610791963618</faster_than_realtime> </benchmark_result> <cpu_info> <vendor>GenuineIntel</vendor> <brand>Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz</brand> <n_cores>4</n_cores> <n_logical_cores>4</n_logical_cores> <l1_data_cache>32768</l1_data_cache> <l1_instruction_cache>32768</l1_instruction_cache> <l2_cache>262144</l2_cache> <l3_cache>6291456</l3_cache> </cpu_info> <memory_info> <total_ram>16623747072</total_ram> <free_ram>4938498048</free_ram> <total_swap>0</total_swap> <free_swap>0</free_swap> </memory_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Returns information about available external TTS connectors.
See also:
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/external/technologies/tts/info"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $options = array( 'http' => array ( 'method' => 'GET', 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/external/technologies/tts/info", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "ExternalTTSResult", "connectors": [ { "vendor": "Acapela", "author": "Phonexia", "version": "1.0.1", "voices": [ { "language_codes": [ "en-US", "cs-CZ" ], "name": "Laura", "natural_sample_rate_hertz": 8000 } ] } ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>ExternalTTSResult</name> <connectors> <item> <vendor>Acapela</vendor> <author>Phonexia</author> <version>1.0.1</version> <voices> <item> <language_codes> <item>en-US</item> <item>cs-CZ</item> </language_codes> <name>Laura</name> <natural_sample_rate_hertz>8000</natural_sample_rate_hertz> </item> </voices> </item> </connectors> </result> |
401Unauthorized |
|
Create new file which will contain speech audio data determined by JSON text content. Generated audio is stored on SPE server on path specified in query parameters. Speech audio is created with voice specified by vendor, name and language_code parameters. To see available voices call /external/technologies/tts/info. Output file is always WAV in PCM 8k format. Server returns info about audio file with speech which was created. This request is asynchronous (see Asynchronous request).
See also Usage examples - External Text To Speech for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
vendor | query | string | yes | Vendor identifying connector to use. |
path | query | string | yes | Server path where will be stored new audio file. Extension of the result is .wav, if user specifies extension different than .wav, it is automatically changed, if no extension is specified, .wav is automatically added. |
{ "tts_input": { "text": "The best way to predict the future is to invent it.", "voice": { "name": "Laura", "language_code": "en-US" } } }
<tts_input> <text>The best way to predict the future is to invent it.</text> <voice> <name>Laura</name> <language_code>en-US</language_code> </voice> </tts_input>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary @"tts_input.json" "SERVER_ADDRESS:PORT/external/technologies/tts?vendor=VENDOR&path=/julia_1.wav"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var tts_input = { "tts_input": { "text": "The best way to predict the future is to invent it.", "voice": { "name": "Laura", "language_code": "en-US" } } }; var options = { method: 'POST', content: tts_input, uri_path: '/external/technologies/tts', uri_params: { path: '/julia_1.wav', vendor: 'VENDOR' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioFileInfoResult", "info": { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioFileInfoResult</name> <info> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Generate speech audio data determined by JSON text content and send through specified output stream out of Speech Engine. Speech audio is created with voice specified by vendor, name and language_code parameters. To see available voices call /external/technologies/tts/info. Server returns info about audio file with speech which was created.
See also Usage examples - External Text To Speech stream for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
vendor | query | string | yes | Vendor identifying connector to use. |
output_stream | query | string | yes | Output stream ID where the result will be sent. (see /output_stream/rtp) |
{ "tts_input": { "text": "The best way to predict the future is to invent it.", "voice": { "name": "Laura", "language_code": "en-US" } } }
<tts_input> <text>The best way to predict the future is to invent it.</text> <voice> <name>Laura</name> <language_code>en-US</language_code> </voice> </tts_input>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary @"tts_input.json" "SERVER_ADDRESS:PORT/external/technologies/tts?vendor=VENDOR&output_stream=29eae856-0004-46a2-a761-9e9a72bad719"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var tts_input = { "tts_input": { "text": "The best way to predict the future is to invent it.", "voice": { "name": "Laura", "language_code": "en-US" } } }; var options = { method: 'POST', content: tts_input, uri_path: '/external/technologies/tts', uri_params: { output_stream: '29eae856-0004-46a2-a761-9e9a72bad719', vendor: 'VENDOR' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "UserOutputStreamTaskInfoResult", "stream_task_info": { "id": "8506180c-e87d-42f6-ac9a-c5ca3a3a3202", "state": "running", "output_stream_id": "29eae856-0004-46a2-a761-9e9a72bad719" } } } <result> <version>1</version> <name>UserOutputStreamTaskInfoResult</name> <stream_task_info> <id>8506180c-e87d-42f6-ac9a-c5ca3a3a3202</id> <state>running</state> <output_stream_id>29eae856-0004-46a2-a761-9e9a72bad719</output_stream_id> </stream_task_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Get status of external TTS speech generation task identified by task ID. Generated speech length value of result is in seconds (floating point numbers). Status of task can be either running or finished. Note that if you're using your own connector, the internal errors of your connector are reported as internal error of SPE. For further investigation of connector error(s) consult the SPE log file.
See also Usage examples - External Text To Speech stream for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Task ID of external TTS task for which the speech generation status should be retreived |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/external/technologies/tts/output_stream?task=TTS_TASK_ID"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "TextToSpeechOutputStreamResult", "state": "finished", "generated_audio_length": 3.68 } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>TextToSpeechOutputStreamResult</name> <state>finished</state> <generated_audio_length>3.68</generated_audio_length> </result> |
401Unauthorized |
|
404Not Found |
|
Stop task generating the speech audio into output stream.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Task ID of TTS task which should be stopped. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/external/technologies/tts/output_stream?task=TTS_TASK_ID"
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Returns diarization of recording. By diarization it is possible to split recording by speakers. Diarization results can be improved by setting query parameters properly. Note that this technology does not identify found speakers. This request is asynchronous (see Asynchronous request).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file |
model | query | string | yes | Name of diarization model |
max_speakers | query | int | no | Maximum number of speakers, i.e. you know that there is at maximum this number of speakers in the audio. Default value is 2. This parameter applies to models O, S and L. |
total_speakers | query | int | no | Total number of speakers, i.e. you know that there is exactly this number of speakers in the audio. This parameter applies only to model O. |
per_channel | query | boolean | no | If true, recording is processed per channel. Processing context is reinitialized for each channel. If false, the channels are concatenated to mono and then processed. Default value is false. |
cache_only | query | boolean | no | If true, cache_only ensures that the result is returned only if it is already in the cache (the result is stored in the cache if the file has already been processed by the technology). If the result isn't in cache yet, only 404 status is returned. This parameter is not mandatory and if it is not set by the user, the recording is processed by the given technology automatically if the result is not already in the cache. Parameters cache_only and cache_disable can not be used together. |
cache_disable | query | boolean | no | If true, the result cache is disabled. cache_disable ensures that the recording is always processed and the result is not stored in the cache. Parameters cache_only and cache_disable can not be used together. |
from_time | query | double | no | from_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed from the beginning. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
to_time | query | double | no | to_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed to the end. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/diarization?path=julia_1.wav&model=S"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/diarization', uri_params: { path: '/julia.wav', model: 'S' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200OK | The time_range parameter in the output is serialized only when query parameters from_time or to_time are specified. JSONXML{ "result": { "version": 3, "name": "DiarizationResult", "file": "julia_1.wav", "model": "S", "max_speakers": 2, "total_speakers": 2, "per_channel": true, "time_range": { "from_time": 2.5, "to_time": 5.5 }, "segmentation": [ { "channel_id": 0, "score": 0, "confidence": 0, "start": 0, "end": 6700000, "word": "silence" }, { "channel_id": 0, "score": 0, "confidence": 0, "start": 6700000, "end": 10200000, "word": "1" }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>DiarizationResult</name> <file>julia_1.wav</file> <model>S</model> <max_speakers>2</max_speakers> <total_speakers>2</total_speakers> <per_channel>true</per_channel> <time_range> <from_time>2.5</from_time> <to_time>5.5</to_time> </time_range> <segmentation> <item> <channel_id>0</channel_id> <score>0</score> <confidence>0</confidence> <start>0</start> <end>6700000</end> <word>silence</word> </item> <item> <channel_id>0</channel_id> <score>0</score> <confidence>0</confidence> <start>6700000</start> <end>10200000</end> <word>1</word> </item> ... </segmentation> </result> Result description
| ||||||||||||||
400Bad Request |
| ||||||||||||||
401Unauthorized |
| ||||||||||||||
404Not Found |
| ||||||||||||||
405Method Not Allowed |
| ||||||||||||||
406Not Acceptable |
| ||||||||||||||
415Unsupported Media Type |
|
Benchmark of Diarization technology with default set of recordings or specified recording (by parameter path).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of Diarization technology model. |
path | query | string | no | Server path to the audio file. If not specified, default recordings will be used. |
max_speakers | query | int | no | Maximum number of speakers, i.e. you know that there is at maximum this number of speakers in the audio. Default value is 2. This parameter applies to models O, S and L. |
total_speakers | query | int | no | Total number of speakers, i.e. you know that there is exactly this number of speakers in the audio. This parameter applies only to model O. |
per_channel | query | boolean | no | If true, recording is processed per channel. Processing context is reinitialized for each channel. If false, the channels are concatenated to mono and then processed. Default value is false. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/diarization/benchmark?model=S"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/diarization/benchmark', uri_params: { model: 'S' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "DiarizationBenchmarkResult", "dataset_version": "1.0", "model_name": "L", "benchmark_result": { "processed_length": 21.31999969482422, "processing_time": 4.0397680000000005, "faster_than_realtime": 5.277530713353889 }, "cpu_info": { "vendor": "GenuineIntel", "brand": "Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz", "n_cores": 4, "n_logical_cores": 4, "l1_data_cache": 32768, "l1_instruction_cache": 32768, "l2_cache": 262144, "l3_cache": 6291456 }, "memory_info": { "total_ram": 16623747072, "free_ram": 5028855808, "total_swap": 0, "free_swap": 0 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>DiarizationBenchmarkResult</name> <dataset_version>1.0</dataset_version> <model_name>L</model_name> <benchmark_result> <processed_length>21.31999969482422</processed_length> <processing_time>4.0397680000000005</processing_time> <faster_than_realtime>5.277530713353889</faster_than_realtime> </benchmark_result> <cpu_info> <vendor>GenuineIntel</vendor> <brand>Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz</brand> <n_cores>4</n_cores> <n_logical_cores>4</n_logical_cores> <l1_data_cache>32768</l1_data_cache> <l1_instruction_cache>32768</l1_instruction_cache> <l2_cache>262144</l2_cache> <l3_cache>6291456</l3_cache> </cpu_info> <memory_info> <total_ram>16623747072</total_ram> <free_ram>4938498048</free_ram> <total_swap>0</total_swap> <free_swap>0</free_swap> </memory_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Create new multi-channel file by diarization. Each channel in target file will correspond to one speaker in original recording.
Output audio file is always WAV. If file specified by parameter target has no extension or extension is other than .wav, then extension .wav is appended.
This request is asynchronous (see Asynchronous request).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file |
target | query | string | yes | Server path to created audio file. The file must not exist |
model | query | string | yes | Name of diarization model |
max_speakers | query | int | no | Maximum number of speakers, i.e. you know that there is at maximum this number of speakers in the audio. Default value is 2. This parameter applies to models O, S and L. |
total_speakers | query | int | no | Total number of speakers, i.e. you know that there is exactly this number of speakers in the audio. This parameter applies only to model O. |
cache_disable | query | boolean | no | If true, result cache will be disabled. Ensures that file will be always processed by diarization and result of diarization will not be stored in cache. |
from_time | query | double | no | from_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed from the beginning. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
to_time | query | double | no | to_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed to the end. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/technologies/diarization/split?path=julia_kelly_1.wav&target=splitted_by_diarization.wav&model=S"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/diarization/split', uri_params: { path: '/julia_kelly_1.wav', target: '/splitted_by_diarization.wav', model: 'S' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioFileInfoResult", "info": { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioFileInfoResult</name> <info> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
406Not Acceptable |
|
415Unsupported Media Type |
|
Returns gender of speaker in record. Depending on available models even multichannel records can be processed. This request is asynchronous (see Asynchronous request).
See also Usage examples - Gender Identification for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file |
model | query | string | yes | Name of gender identification model |
cache_only | query | boolean | no | If true, cache_only ensures that the result is returned only if it is already in the cache (the result is stored in the cache if the file has already been processed by the technology). If the result isn't in cache yet, only 404 status is returned. This parameter is not mandatory and if it is not set by the user, the recording is processed by the given technology automatically if the result is not already in the cache. Parameters cache_only and cache_disable can not be used together. |
cache_disable | query | boolean | no | If true, the result cache is disabled. cache_disable ensures that the recording is always processed and the result is not stored in the cache. Parameters cache_only and cache_disable can not be used together. |
from_time | query | double | no | from_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed from the beginning. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
to_time | query | double | no | to_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed to the end. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/genderid?model=GENERIC&path=julia_1.wav"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/genderid', uri_params: { path: '/julia.wav', model: 'DEFUALT' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | The score is posterior probability of speaker being male or female (in range 0.0-1.0) whereas score_llr is the log likelihood ratio. The time_range parameter in the output is serialized only when query parameters from_time or to_time are specified. JSONXML{ "result": { "version": 3, "name": "GenderIdentificationResult", "file": "julia_1.wav", "model": "GENERIC", "time_range": { "from_time": 2.5, "to_time": 5.5 }, "channel_scores": [ { "channel": 0, "scores": [ { "name": "Female", "score": 0.9989388, "score_llr": 3.4236698 }, { "name": "Male", "score": 0.00106118135, "score_llr": -3.423641 } ] } ] } } <result> <version>3</version> <name>GenderIdentificationResult</name> <file>julia_1.wav</file> <model>GENERIC</model> <time_range> <from_time>2.5</from_time> <to_time>5.5</to_time> </time_range> <channel_scores> <item> <channel>0</channel> <scores> <item> <name>Female</name> <score>0.9989388</score> <score_llr>3.4236698</score_llr> </item> <item> <name>Male</name> <score>0.00106118135</score> <score_llr>-3.423641</score_llr> </item> </scores> </item> </channel_scores> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
406Not Acceptable |
|
415Unsupported Media Type |
|
Returns gender of speaker in SID voiceprint. Use request GET /technologies/speakerid/extractvp to extract voiceprint from recording. It is necessary to use same name of GID model as name of SID model used for voiceprint extraction (for example: voiceprint extracted with model XL3 must be processed only with GID model XL3) otherwise server returns http error 500.
This request is asynchronous (see Asynchronous request).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of gender identification model. Use the same model name as used during the voiceprint extraction. |
Content-Type | header | string | yes | application/json for JSON content (Default value) application/xml for XML content application/octet-stream for raw voiceprint content |
{ "voiceprint": "<Base64 Data>" }
<?xml version="1.0" encoding="UTF-8"?> <voiceprint>[Base64 Data]</voiceprint>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary @"voiceprint.json" "SERVER_ADDRESS:PORT/technologies/genderid?model=XL3"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/technologies/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ya1FP5QOOD+QHoy\/6BbNP6rogz\/2vDw\/Ktzsv\/jGKD7YraG9gmxiP9zZ3b70ibW\/AM5TO9Z\/Pz+wsYs+0lEmv+qV8r44r8K\/GvL0Pw3xXz90+vu+zybOP\/9pzb75kxk\/27ASP78ziz8EJFK\/rp2av8u1tL95tyhAiBdcv8R9wj74NMC+lGdLvjT13z9+mdW\/guOzPgf3EEAAXQM\/0IRUvZR5sr8dz1i\/gSjrP80k4T9OCJA\/gjKOv8qoTz9A75U8jU24P940C8DWj1q+5TfHv586m791RqG\/GmsTP4T7mb8It2k+GE20vyApn78yxDXAkGxcvcJKMb74pRO\/BrqdPnlqvb\/gAR69GOtkP4xpfj8R2hJAmFckQBYlzj5AozC8F\/zXP5jMrT\/\/kwhAEFrmP3ybib90rec\/JaF6v8d5bz\/WziZAVC3aP5BYE8BGe62\/JD3KvkiXEL7M9YU+8uqivqDyDT8qYJs\/IQPOP4jCFL9OgA7ANZkFwCUCbz8qIRw\/HRtGvix5k7\/IZHO+AmEmv5BVNsCLMKy+oJi3vfCHNr96878+gEkewP57EsA8z8S\/d15GwMHViD4juEVAnO9dvvPL7L+o8nO\/tCcxv3ZB9D+uaRFAb9pqv3haA8A35JpAYCh0v7BKPTzB92tA9teFwFEj3kCwQq6\/N2uEP+AdsT8=" }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | The score is posterior probability of speaker being male or female (in range 0.0-1.0) whereas score_llr is the log likelihood ratio. JSONXML{ "result": { "version": 3, "name": "GenderIdentificationResult", "file": "{voiceprint}", "model": "XL3", "channel_scores": [ { "channel": 0, "scores": [ { "name": "Female", "score": 0.9989388, "score_llr": 3.4236698 }, { "name": "Male", "score": 0.00106118135, "score_llr": -3.423641 } ] } ] } } <result> <version>3</version> <name>GenderIdentificationResult</name> <file>{voiceprint}</file> <model>XL3</model> <channel_scores> <item> <channel>0</channel> <scores> <item> <name>Female</name> <score>0.9989388</score> <score_llr>3.4236698</score_llr> </item> <item> <name>Male</name> <score>0.00106118135</score> <score_llr>-3.423641</score_llr> </item> </scores> </item> </channel_scores> </result> |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Benchmark of Gender Identification technology with default set of recordings or specified recording (by parameter path).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of Gender Identification technology model. |
path | query | string | no | Server path to the audio file. If not specified, default recordings will be used. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/genderid/benchmark?model=GENERIC"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/genderid/benchmark', uri_params: { model: 'GENERIC' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "GenderIdentificationBenchmarkResult", "dataset_version": "1.0", "model_name": "GENERIC", "benchmark_result": { "processed_length": 21.31999969482422, "processing_time": 0.094189, "faster_than_realtime": 226.35339259174873 }, "cpu_info": { "vendor": "GenuineIntel", "brand": "Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz", "n_cores": 4, "n_logical_cores": 4, "l1_data_cache": 32768, "l1_instruction_cache": 32768, "l2_cache": 262144, "l3_cache": 6291456 }, "memory_info": { "total_ram": 16623747072, "free_ram": 5028855808, "total_swap": 0, "free_swap": 0 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>GenderIdentificationBenchmarkResult</name> <dataset_version>1.0</dataset_version> <model_name>GENERIC</model_name> <benchmark_result> <processed_length>21.31999969482422</processed_length> <processing_time>0.094189</processing_time> <faster_than_realtime>226.35339259174873</faster_than_realtime> </benchmark_result> <cpu_info> <vendor>GenuineIntel</vendor> <brand>Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz</brand> <n_cores>4</n_cores> <n_logical_cores>4</n_logical_cores> <l1_data_cache>32768</l1_data_cache> <l1_instruction_cache>32768</l1_instruction_cache> <l2_cache>262144</l2_cache> <l3_cache>6291456</l3_cache> </cpu_info> <memory_info> <total_ram>16623747072</total_ram> <free_ram>4938498048</free_ram> <total_swap>0</total_swap> <free_swap>0</free_swap> </memory_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Search for keywords in the given audio file. A list of searched keywords is determined by the kwlist parameter. Keyword spotting is language dependent technology and therefore has the model parameter that determines desired language (see model parameter description).
Returns list of found words. Every found word contains start and end time in the HTK units (hundreds of nanoseconds), raw score, confidence in the range from zero to one, channel id for identifying in which the word was said and text of word with suffix separate by the underscore character that contains either the number of the pronunciation or directly text of the pronunciation (see example output).
This request is asynchronous (see Asynchronous request).See also Usage examples - Keyword Spotting for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file. |
model | query | string | yes | Name of keyword spotting model. For list of supported models use object /technologies/. |
kwlist | query | string | yes | Name of keyword list. |
cache_only | query | boolean | no | If true, cache_only ensures that the result is returned only if it is already in the cache (the result is stored in the cache if the file has already been processed by the technology). If the result isn't in cache yet, only 404 status is returned. This parameter is not mandatory and if it is not set by the user, the recording is processed by the given technology automatically if the result is not already in the cache. Parameters cache_only and cache_disable can not be used together. |
cache_disable | query | boolean | no | If true, the result cache is disabled. cache_disable ensures that the recording is always processed and the result is not stored in the cache. Parameters cache_only and cache_disable can not be used together. |
from_time | query | double | no | from_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed from the beginning. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
to_time | query | double | no | to_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed to the end. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/keywordspotting?path=/julia.wav&model=EN_US_6&kwlist=test"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/keywordspotting', uri_params: { path: '/julia.wav', model: 'EN_US_6', kwlist: 'test' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200OK | The time_range parameter in the output is serialized only when query parameters from_time or to_time are specified. JSONXML{ "result": { "version": 2, "name": "KeywordSpottingResult", "file": "julia_1.wav", "keyword_list": "test", "model": "EN_US_6", "time_range": { "from_time": 2.5, "to_time": 5.5 }, "words": [ { "channel_id": 0, "score": 0.7887516, "confidence": 0.6875632, "start": 94900000, "end": 96400000, "word": "this_1" }, { "channel_id": 0, "score": 0.1522667, "confidence": 0.5379933, "start": 99900000, "end": 101900000, "word": "this_1" }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>KeywordSpottingResult</name> <file>julia_1.wav</file> <keyword_list>test</keyword_list> <model>EN_US_6</model> <time_range> <from_time>2.5</from_time> <to_time>5.5</to_time> </time_range> <words> <item> <channel_id>0</channel_id> <score>0.7887516</score> <confidence>0.6875632</confidence> <start>94900000</start> <end>96400000</end> <word>this_1</word> </item> <item> <channel_id>0</channel_id> <score>0.1522667</score> <confidence>0.5379933</confidence> <start>99900000</start> <end>101900000</end> <word>this_1</word> </item> ... </words> </result> Result description
| ||||||||||||||||
400Bad Request |
| ||||||||||||||||
401Unauthorized |
| ||||||||||||||||
404Not Found |
| ||||||||||||||||
405Method Not Allowed |
| ||||||||||||||||
406Not Acceptable |
| ||||||||||||||||
415Unsupported Media Type |
|
Benchmark of Keyword Spotting technology with specified recording and keyword list.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of Keyword Spotting technology model. |
kwlist | query | string | yes | Name of keyword list. |
path | query | string | yes | Server path to the audio file. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/keywordspotting/benchmark?path=/julia_1.wav&model=EN_US_6&kwlist=test"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/keywordspotting/benchmark', uri_params: { path: '/julia.wav', model: 'EN_US_6', kwlist: 'test' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "KeywordSpottingBenchmarkResult", "model_name": "EN_US_6", "file": "/julia_1.wav", "keyword_list": "test", "benchmark_result": { "processed_length": 22.970001220703125, "processing_time": 0.772678, "faster_than_realtime": 29.72777951579199 }, "cpu_info": { "vendor": "AuthenticAMD", "brand": "AMD Ryzen Threadripper 1950X 16-Core Processor ", "n_cores": 16, "n_logical_cores": 32, "l1_data_cache": 32768, "l1_instruction_cache": 65536, "l2_cache": 524288, "l3_cache": 33554432 }, "memory_info": { "total_ram": 33586036736, "free_ram": 12178698240, "total_swap": 4000313344, "free_swap": 3997679616 } } } <?xml version='1.0' encoding='UTF-8'?> <result> <version>1</version> <name>KeywordSpottingBenchmarkResult</name> <model_name>EN_US_6</model_name> <file>/julia_1.wav</file> <keyword_list>test</keyword_list> <benchmark_result> <processed_length>22.970001220703125</processed_length> <processing_time>0.766164</processing_time> <faster_than_realtime>29.98052795576812</faster_than_realtime> </benchmark_result> <cpu_info> <vendor>AuthenticAMD</vendor> <brand>AMD Ryzen Threadripper 1950X 16-Core Processor </brand> <n_cores>16</n_cores> <n_logical_cores>32</n_logical_cores> <l1_data_cache>32768</l1_data_cache> <l1_instruction_cache>65536</l1_instruction_cache> <l2_cache>524288</l2_cache> <l3_cache>33554432</l3_cache> </cpu_info> <memory_info> <total_ram>33586036736</total_ram> <free_ram>12187668480</free_ram> <total_swap>4000313344</total_swap> <free_swap>3997679616</free_swap> </memory_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Get partial result from task analyzing input stream identified by task ID. A list of searched keywords is determined by the kwlist parameter in http POST for creating keyword spotting task. Keyword spotting is language dependent technology and therefore has the model parameter that determines desired language (see model parameter description).
Returns list of found words. Every found word contains start and end time in the HTK units (hundreds of nanoseconds), raw score, confidence in the range from zero to one, channel id for identifying in which the word was said and text of word with suffix separate by the underscore character that contains either the number of the pronunciation or directly text of the pronunciation (see example output).
This request also can be used for registration of Webhook callback or WebSocket handshake.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Input stream Task ID which the request will be attached to |
interval | query | double | no | Time interval (in seconds) used for delivery updates of task results via WebSocket or WebHook (it does not affect when using polling). The default value is 0, which ensures that results are delivered as soon as possible. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/keywordspotting/input_stream?task=INPUT_STREAM_TASK_ID"
HTTP Status | Output | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200OK | JSONXML{ "result": { "version": 2, "name": "KeywordSpottingStreamResult", "model": "EN_US_6", "is_last": false, "task_id": "42afa238-412b-4673-9bb7-170a762503c1", "task_execution_time": 32.4365, "input_stream_id": "fe9525ef-d18a-4826-869e-b5a31b1c57c5", "keyword_list": "test_keywordlist", "words": [ { "channel_id": 0, "score": 0.7887516, "confidence": 0.6875632, "start": 94900000, "end": 96400000, "word": "this_1" }, { "channel_id": 0, "score": 0.1522667, "confidence": 0.5379933, "start": 99900000, "end": 101900000, "word": "this_1" }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>KeywordSpottingStreamResult</name> <model>EN_US_6</model> <is_last>false</is_last> <task_id>42afa238-412b-4673-9bb7-170a762503c1</task_id> <task_execution_time>32.43656</task_execution_time> <input_stream_id>fe9525ef-d18a-4826-869e-b5a31b1c57c5</input_stream_id> <keyword_list>test_keywordlist</keyword_list> <words> <item> <channel_id>0</channel_id> <score>0.7887516</score> <confidence>0.6875632</confidence> <start>94900000</start> <end>96400000</end> <word>this_1</word> </item> <item> <channel_id>0</channel_id> <score>0.1522667</score> <confidence>0.5379933</confidence> <start>99900000</start> <end>101900000</end> <word>this_1</word> </item> ... </words> </result> Result description
| ||||||||||||||||||||||||
400Bad Request |
| ||||||||||||||||||||||||
401Unauthorized |
| ||||||||||||||||||||||||
404Not Found |
| ||||||||||||||||||||||||
405Method Not Allowed |
|
Start analyzing input stream.
This technology can not be attached to multichannel input stream.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
input_stream | query | string | yes | Input stream ID which the request will be attached to |
model | query | string | yes | Name of KWS model. Not all KWS models support stream feature, you can check your server configuration by GET /technologies |
kwlist | query | string | yes | Name of keyword list. |
result_mode | query | string | no | Mode of getting result. Allowed modes are complete, incremental (default complete). See RTP/HTTP streams for more information. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/technologies/keywordspotting/input_stream?input_stream=INPUT_STREAM_ID&model=EN_US_6&kwlist=test"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "UserStreamTaskInfoResult", "stream_task_info": { "id": "8506180c-e87d-42f6-ac9a-c5ca3a3a3202", "state": "running", "input_stream_id": "29eae856-0004-46a2-a761-9e9a72bad719" } } } <result> <version>1</version> <name>UserStreamTaskInfoResult</name> <stream_task_info> <id>8506180c-e87d-42f6-ac9a-c5ca3a3a3202</id> <state>running</state> <input_stream_id>29eae856-0004-46a2-a761-9e9a72bad719</input_stream_id> </stream_task_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
503Service Unavailable |
|
Stop task analyzing input stream identified by task ID.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Input stream Task ID which the request will be attached to |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/keywordspotting/input_stream?task=STREAM_TASK_ID"
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Returns list of user's keyword lists. Technology model must be specified as keyword list depends on language.
See also Usage examples - Keyword Spotting for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of keyword spotting technology model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/keywordspotting/kwlists?model=EN_US_6"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "EN_US_6"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/keywordspotting/kwlists?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "KeywordSpottingListsResult", "model_name": "EN_US_6", "kwlists": [ "test" ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>KeywordSpottingListsResult</name> <model_name>EN_US_6</model_name> <kwlists> <item>test</item> </kwlists> </result> |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Returns keyword list information.
See also Usage examples - Keyword Spotting for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Determines the name of keyword list. |
model | query | string | yes | Name of keyword spotting model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/keywordspotting/kwlists/test?model=EN_US_6"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "EN_US_6"; $KWLIST_NAME = "test"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/keywordspotting/kwlists/$KWLIST_NAME?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 2, "name": "KeywordSpottingListResult", "model_name": "EN_US_6", "keyword_list": "test", "keywords": [ { "name": "angels", "enabled": true, "threshold": 0.5, "pronunciations": [ ] }, { "name": "there", "enabled": true, "threshold": 0, "pronunciations": [ ] }, { "name": "test", "enabled": true, "threshold": 0.4, "pronunciations": [ { "phonemes": "t E s t", "enabled": true, "probability": 0, "is_valid": true } ] } ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>KeywordSpottingListResult</name> <model_name>EN_US_6</model_name> <keyword_list>test</keyword_list> <keywords> <item> <name>angels</name> <enabled>true</enabled> <threshold>0.5</threshold> <pronunciations/> </item> <item> <name>there</name> <enabled>true</enabled> <threshold>0</threshold> <pronunciations/> </item> <item> <name>test</name> <enabled>true</enabled> <threshold>0.4</threshold> <pronunciations> <item> <phonemes>t E s t</phonemes> <enabled>true</enabled> <probability>0</probability> <is_valid>true</is_valid> </item> </pronunciations> </item> </keywords> </result> |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Add keyword list to server. If the keyword list with the same name already exists, it automatically overwrites the newly uploaded content. The request body contains keyword list. Each keyword may contain "threshold" property. The result of KWS will only contain keywords whose confindence is higher or equeal than the "threshold".
See also Usage examples - Keyword Spotting for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | yes | application/json for JSON content (Default value) application/xml for XML content |
name | path | string | yes | Determines the name of keyword list. |
model | query | string | yes | Name of keyword spotting model |
{ "keywords": [ { "name": "angels", "enabled": true, "threshold": 0.5 }, { "name": "there", "enabled": true, "threshold": 0 }, { "name": "test", "enabled": true, "threshold": 0.4, "pronunciations": [ { "phonemes": "t E s t", "enabled": true } ] } ] }
<keywords> <item> <name>angels</name> <enabled>true</enabled> <threshold>0.5</threshold> </item> <item> <name>there</name> <enabled>true</enabled> <threshold>0</threshold> </item> <item> <name>test</name> <enabled>true</enabled> <threshold>0.4</threshold> <pronunciations> <item> <phonemes>t E s t</phonemes> <enabled>true</enabled> </item> </pronunciations> </item> </keywords>
keywords[] | List of keywords |
---|---|
keywords[]->name | Keyword consist of graphemes. Use this request to obtain allowed graphemes. Using invalid graphemes in keyword causes HTTP error 400 (error code 1019) |
keywords[]->enabled | Enables or disables this keyword |
keywords[]->threshold | If the confidence of occurrence of the keyword is above the threshold, the occurrence is passed into the result. Parameter is optional (default value is 0.0). |
keywords[]->pronunciations[] | Array of custom pronunciations of keyword. Parameter is optional. If parameter is not specified, default pronunciation is used. See also this request to obtain default pronunciation. |
keywords[]->pronunciations[]->phonemes | Pronunciation of keyword consist of phonemes separed by space. Use this request to obtain allowed phonemes. Using invalid phonemes in pronunciation causes HTTP error 400 (error code 1019) |
keywords[]->pronunciations[]->enabled | Enables or disables this pronunciation |
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary @"kwlist.json" "SERVER_ADDRESS:PORT/technologies/keywordspotting/kwlists/test?model=EN_US_6"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "EN_US_6"; $KWLIST_NAME = "test"; $keywords = array( 'keywords' => array ( array ( 'name' => "angels", 'enabled' => true, ), array ( 'name' => "there", 'enabled' => true, ), array ( 'name' => "test", 'enabled' => true, 'pronunciations' => array ( array ( 'phonemes' => "t E s t", 'enabled' => true, ) ) ), ) ); $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: application/json', 'content' => json_encode($keywords), 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/keywordspotting/kwlists/$KWLIST_NAME?model=$MODEL", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Delete keyword list with specified name.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Determines the name of keyword list. |
model | query | string | yes | Name of keyword spotting model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/keywordspotting/kwlists/test?model=EN_US_6"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "EN_US_6"; $KWLIST_NAME = "test"; $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'content' => json_encode($keywords), 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/keywordspotting/kwlists/$KWLIST_NAME?model=$MODEL", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Return supported graphemes for given kws model.
See also Usage examples - Keyword Spotting for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of keyword spotting model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/keywordspotting/graphemes?model=EN_US_6"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "EN_US_6"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/keywordspotting/graphemes?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 2, "name": "GraphemeResult", "graphemes": [ "a", "b", ... ], "word_separator": "+" } } <result> <version>2</version> <name>GraphemeResult</name> <graphemes> <item>a</item> <item>b</item> ... </graphemes> <word_separator>+</word_separator> </result> |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Return supported phonemes for given kws model.
See also Usage examples - Keyword Spotting for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of keyword spotting model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/keywordspotting/phonemes?model=EN_US_6"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "EN_US_6"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/keywordspotting/phonemes?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "PhonemesListResult", "phonemes": [ "@", "@r", ... ] } } <result> <version>1</version> <name>PhonemesListResult</name> <phonemes> <item>@</item> <item>@r</item> ... </phonemes> </result> |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Returns pronunciation list for keyword. This request is asynchronous, after first call returns pending operation path in header of reply. By sending request with this path is possible to acquire result of operation (see Asynchronous request).
Important notice: The + sign (used in phrases to separate words) in the URL must be encoded as %2B. For example if you want pronunciation of hello+world phrase you have to use: keyword=hello%2Bworld
See also Usage examples - Keyword Spotting for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
keyword | query | string | yes | Keyword. |
model | query | string | yes | Name of keyword spotting model |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/keywordspotting/pronunciation?keyword=hello%2Bworld&model=EN_US_6"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/keywordspotting/pronunciation', uri_params: { keyword: 'hello%2Bworld', model: 'EN_US_6' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "KeywordSpottingPronunciationResult", "model": "EN_US_6", "keyword": "hello+world", "pronunciations": [ "h E l oU w @r l d" ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>KeywordSpottingPronunciationResult</name> <model>EN_US_6</model> <keyword>hello+world</keyword> <pronunciations> <item>h E l oU w @r l d</item> </pronunciations> </result> |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Returns phoneme transcription for specified audio file. This request is asynchronous (see Asynchronous request).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file |
model | query | string | yes | Name of technology model |
cache_only | query | boolean | no | If true, cache_only ensures that the result is returned only if it is already in the cache (the result is stored in the cache if the file has already been processed by the technology). If the result isn't in cache yet, only 404 status is returned. This parameter is not mandatory and if it is not set by the user, the recording is processed by the given technology automatically if the result is not already in the cache. Parameters cache_only and cache_disable can not be used together. |
cache_disable | query | boolean | no | If true, the result cache is disabled. cache_disable ensures that the recording is always processed and the result is not stored in the cache. Parameters cache_only and cache_disable can not be used together. |
from_time | query | double | no | from_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed from the beginning. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
to_time | query | double | no | to_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed to the end. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/phnrec?path=julia.wav&model=EN_US_6"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/phnrec', uri_params: { path: '/julia.wav', model: 'EN_US_6' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | Parameter time_range in output is present only when query parameters from_time or to_time are specified. JSONXML{ "result": { "version": 1, "name": "PhonemeRecognitionResult", "file": "julia_1.wav", "model": "EN_US_6", "time_range": { "from_time": 2.5, "to_time": 5.5 }, "segmentation": [ { "channel_id": 0, "score": -10.173214, "confidence": -10.173214, "start": 300000, "end": 1100000, "word": "sil" }, { "channel_id": 0, "score": -28.361546, "confidence": -28.361546, "start": 1100000, "end": 2500000, "word": "aU" }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>PhonemeRecognitionResult</name> <file>julia_1.wav</file> <model>EN_US_6</model> <time_range> <from_time>2.5</from_time> <to_time>5.5</to_time> </time_range> <segmentation> <item> <channel_id>0</channel_id> <score>-10.173214</score> <confidence>-10.173214</confidence> <start>300000</start> <end>1100000</end> <word>sil</word> </item> <item> <channel_id>0</channel_id> <score>-28.361546</score> <confidence>-28.361546</confidence> <start>1100000</start> <end>2500000</end> <word>aU</word> </item> ... </segmentation> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
406Not Acceptable |
|
415Unsupported Media Type |
|
Benchmark of Phoneme Transcription technology with default set of recordings or specified recording (by parameter path).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of Phoneme Transcription technology model. |
path | query | string | no | Server path to the audio file. If not specified, default recordings will be used. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/phnrec/benchmark?model=EN_US_6"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/phnrec/benchmark', uri_params: { model: 'EN_US_6' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "PhonemeRecognitionBenchmarkResult", "dataset_version": "1.0", "model_name": "EN_US_6", "benchmark_result": { "processed_length": 1017.0399360656738, "processing_time": 25.795139, "faster_than_realtime": 39.42758114486896 }, "cpu_info": { "vendor": "GenuineIntel", "brand": "Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz", "n_cores": 4, "n_logical_cores": 4, "l1_data_cache": 32768, "l1_instruction_cache": 32768, "l2_cache": 262144, "l3_cache": 6291456 }, "memory_info": { "total_ram": 16623747072, "free_ram": 5028855808, "total_swap": 0, "free_swap": 0 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>PhonemeRecognitionBenchmarkResult</name> <dataset_version>1.0</dataset_version> <model_name>EN_US_6</model_name> <benchmark_result> <processed_length>1017.0399360656738</processed_length> <processing_time>25.279305</processing_time> <faster_than_realtime>40.23211619408341</faster_than_realtime> </benchmark_result> <cpu_info> <vendor>GenuineIntel</vendor> <brand>Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz</brand> <n_cores>4</n_cores> <n_logical_cores>4</n_logical_cores> <l1_data_cache>32768</l1_data_cache> <l1_instruction_cache>32768</l1_instruction_cache> <l2_cache>262144</l2_cache> <l3_cache>6291456</l3_cache> </cpu_info> <memory_info> <total_ram>16623747072</total_ram> <free_ram>4938498048</free_ram> <total_swap>0</total_swap> <free_swap>0</free_swap> </memory_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
This endpoint is deprecated since SPE 3.23.x. Use GET /technologies/keywordspotting/input_stream instead.
Get partial result from task analyzing stream identified by task ID. A list of searched keywords is determined by the kwlist parameter in http POST for creating keyword spotting task. Keyword spotting is language dependent technology and therefore has the model parameter that determines desired language (see model parameter description).
Returns list of found words. Every found word contains start and end time in the HTK units (hundreds of nanoseconds), raw score, confidence in the range from zero to one, channel id for identifying in which the word was said and text of word with suffix separate by the underscore character that contains either the number of the pronunciation or directly text of the pronunciation (see example output).
This request also can be used for registration of Webhook callback or WebSocket handshake.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Stream Task ID which the request will be attached to |
interval | query | double | no | Time interval (in seconds) used for delivery updates of task results via WebSocket or WebHook (it does not affect when using polling). The default value is 0, which ensures that results are delivered as soon as possible. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/keywordspotting/stream?task=STREAM_TASK_ID"
HTTP Status | Output | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "KeywordSpottingStreamResult", "model": "EN_US_6", "is_last": false, "task_id": "42afa238-412b-4673-9bb7-170a762503c1", "task_execution_time": 32.4365, "stream_id": "fe9525ef-d18a-4826-869e-b5a31b1c57c5", "keyword_list": "test_keywordlist", "words": [ { "channel_id": 0, "score": 0.7887516, "confidence": 0.6875632, "start": 94900000, "end": 96400000, "word": "this_1" }, { "channel_id": 0, "score": 0.1522667, "confidence": 0.5379933, "start": 99900000, "end": 101900000, "word": "this_1" }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>KeywordSpottingStreamResult</name> <model>EN_US_6</model> <is_last>false</is_last> <task_id>42afa238-412b-4673-9bb7-170a762503c1</task_id> <task_execution_time>32.43656</task_execution_time> <stream_id>fe9525ef-d18a-4826-869e-b5a31b1c57c5</stream_id> <keyword_list>test_keywordlist</keyword_list> <words> <item> <channel_id>0</channel_id> <score>0.7887516</score> <confidence>0.6875632</confidence> <start>94900000</start> <end>96400000</end> <word>this_1</word> </item> <item> <channel_id>0</channel_id> <score>0.1522667</score> <confidence>0.5379933</confidence> <start>99900000</start> <end>101900000</end> <word>this_1</word> </item> ... </words> </result> Result description
| ||||||||||||||||||||||||
400Bad Request |
| ||||||||||||||||||||||||
401Unauthorized |
| ||||||||||||||||||||||||
404Not Found |
| ||||||||||||||||||||||||
405Method Not Allowed |
|
This endpoint is deprecated since SPE 3.23.x. Use POST /technologies/keywordspotting/input_stream instead.
Start analyzing stream.This technology can not be attached to multichannel stream.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
stream | query | string | yes | Stream ID which the request will be attached to |
model | query | string | yes | Name of KWS model. Not all KWS models support stream feature, you can check your server configuration by GET /technologies |
kwlist | query | string | yes | Name of keyword list. |
result_mode | query | string | no | Mode of getting result. Allowed modes are complete, incremental (default complete). See RTP/HTTP streams for more information. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/technologies/keywordspotting/stream?stream=STREAM_ID&model=EN_US_6&kwlist=test"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "UserStreamTaskInfoResult", "stream_task_info": { "id": "8506180c-e87d-42f6-ac9a-c5ca3a3a3202", "state": "running", "stream_id": "29eae856-0004-46a2-a761-9e9a72bad719" } } } <result> <version>1</version> <name>UserStreamTaskInfoResult</name> <stream_task_info> <id>8506180c-e87d-42f6-ac9a-c5ca3a3a3202</id> <state>running</state> <stream_id>29eae856-0004-46a2-a761-9e9a72bad719</stream_id> </stream_task_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
503Service Unavailable |
|
This endpoint is deprecated since SPE 3.23.x. Use DELETE /technologies/keywordspotting/input_stream instead.
Stop task analyzing stream identified by task ID.Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Stream Task ID which the request will be attached to |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/keywordspotting/stream?task=STREAM_TASK_ID"
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Returns language identification scores for specified audio file. This request is asynchronous (see Asynchronous request).
See also Usage examples - Language Identification for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file. |
model | query | string | yes | Name of LID model. |
language_pack | query | string | yes | Name of language pack. |
cache_only | query | boolean | no | If true, cache_only ensures that the result is returned only if it is already in the cache (the result is stored in the cache if the file has already been processed by the technology). If the result isn't in cache yet, only 404 status is returned. This parameter is not mandatory and if it is not set by the user, the recording is processed by the given technology automatically if the result is not already in the cache. Parameters cache_only and cache_disable can not be used together. |
cache_disable | query | boolean | no | If true, the result cache is disabled. cache_disable ensures that the recording is always processed and the result is not stored in the cache. Parameters cache_only and cache_disable can not be used together. |
from_time | query | double | no | from_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed from the beginning. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
to_time | query | double | no | to_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed to the end. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/languageid?path=/julia_1.wav&model=L4&language_pack=default"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/languageid', uri_params: { path: '/julia_1.wav', model: 'L4', language_pack: 'default' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
200OK | The time_range parameter in the output is serialized only when query parameters from_time or to_time are specified. JSONXML{ "result": { "version": 2, "name": "LanguageIdentificationResult", "file": "julia_1.wav", "language_pack": "default", "model": "L4", "time_range": { "from_time": 2.5, "to_time": 5.5 }, "channel_scores": [ { "channel": 0, "scores": [ { "name": "am-ET", "score": -12.136661 }, { "name": "ar-EG", "score": -6.9975476 }, ... ] } ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>LanguageIdentificationResult</name> <file>julia_1.wav</file> <language_pack>default</language_pack> <model>L</model> <time_range> <from_time>2.5</from_time> <to_time>5.5</to_time> </time_range> <channel_scores> <item> <channel>0</channel> <scores> <item> <name>am-ET</name> <score>-12.136661</score> </item> <item> <name>ar-EG</name> <score>-6.9975476</score> </item> ... </scores> </item> </channel_scores> </result> Scores object description
| ||||||||||
400Bad Request |
| ||||||||||
401Unauthorized |
| ||||||||||
404Not Found |
| ||||||||||
405Method Not Allowed |
| ||||||||||
406Not Acceptable |
| ||||||||||
415Unsupported Media Type |
|
Benchmark of Language Identification technology with default set of recordings or specified recording (by parameter path).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of Language Identification technology model. |
path | query | string | no | Server path to the audio file. If not specified, default recordings will be used. |
language_pack | query | string | no | Name of language pack. If not specified, language pack 'default' will be used. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/languageid/benchmark?model=L4"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/languageid/benchmark', uri_params: { model: 'L4' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "LanguageIdentificationBenchmarkResult", "dataset_version": "1.0", "model_name": "L4", "benchmark_result": { "processed_length": 21.31999969482422, "processing_time": 1.348421, "faster_than_realtime": 15.811085480591164 }, "cpu_info": { "vendor": "GenuineIntel", "brand": "Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz", "n_cores": 4, "n_logical_cores": 4, "l1_data_cache": 32768, "l1_instruction_cache": 32768, "l2_cache": 262144, "l3_cache": 6291456 }, "memory_info": { "total_ram": 16623747072, "free_ram": 5028855808, "total_swap": 0, "free_swap": 0 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>LanguageIdentificationBenchmarkResult</name> <dataset_version>1.0</dataset_version> <model_name>L4</model_name> <benchmark_result> <processed_length>21.31999969482422</processed_length> <processing_time>1.348421</processing_time> <faster_than_realtime>15.811085480591164</faster_than_realtime> </benchmark_result> <cpu_info> <vendor>GenuineIntel</vendor> <brand>Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz</brand> <n_cores>4</n_cores> <n_logical_cores>4</n_logical_cores> <l1_data_cache>32768</l1_data_cache> <l1_instruction_cache>32768</l1_instruction_cache> <l2_cache>262144</l2_cache> <l3_cache>6291456</l3_cache> </cpu_info> <memory_info> <total_ram>16623747072</total_ram> <free_ram>4938498048</free_ram> <total_swap>0</total_swap> <free_swap>0</free_swap> </memory_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Extract language print(s) from audio file. This request is asynchronous (see Asynchronous request).
Note: Language prints in result->languageprints[]->languageprint are encoded in Base64. To create *.lp file you will need to decode it first.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file. |
model | query | string | yes | Name of LID model. |
from_time | query | double | no | from_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed from the beginning. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
to_time | query | double | no | to_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed to the end. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/languageid/extractlp?path=kelly_julia.wav&model=L4"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/languageid/extractlp', uri_params: { path: '/kelly_julia.wav', model: 'L4', }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | The time_range parameter in the output is serialized only when query parameters from_time or to_time are specified. JSONXML{ "result": { "version": 2, "name": "LanguagePrintResult", "file": "/kelly_julia.wav", "model": "L4", "time_range": { "from_time": 2.5, "to_time": 5.5 }, "languageprints": [ { "languageprint": <Base64 Data>, "speech_length": 21.34 }, { "languageprint": <Base64 Data>, "speech_length": 26.35 }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>LanguagePrintResult</name> <file>/kelly_julia.wav</file> <model>L4</model> <time_range> <from_time>2.5</from_time> <to_time>5.5</to_time> </time_range> <languageprints> <item> <languageprint>[Base64 Data]</languageprint> <speech_length>21.34</speech_length> </item> <item> <languageprint>[Base64 Data]</languageprint> <speech_length>26.35</speech_length> </item> ... </languageprints> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
406Not Acceptable |
|
415Unsupported Media Type |
|
Compare languageprint in POST body to defined language pack in parameter.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content |
model | query | string | yes | Name of LID model. |
language_pack | query | string | yes | Name of language pack. |
{ "languageprint": <Base64 Data> }
<languageprint>[Base64 Data]</languageprint>
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST -H "Content-Type:application/json" --data-binary @"lprint.json" "SERVER_ADDRESS:PORT/technologies/languageid/comparelp?model=L4&language_pack=default"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/technologies/languageid/comparevp', uri_params: { model: 'L4' }, content: { "languageprint": <Base64 Data> }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "LanguagePrintCompareToLanguagePackResult", "language_pack": "default", "model": "L4", "scores": [ { "name": "am-ET", "score": -12.136661 }, { "name": "ar-EG", "score": -6.9975476 }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>LanguagePrintCompareToLanguagePackResult</name> <language_pack>default</language_pack> <model>L</model> <scores> <item> <name>am-ET</name> <score>-12.136661</score> </item> <item> <name>ar-EG</name> <score>-6.9975476</score> </item> ... </scores> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Returns information about the languageprint posted in the request body. The languageprint can contains multiple sub-languageprints. For each sub-languageprint the server returns version, speech_length (in seconds) and user_data (base64 encoded).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | yes | application/json for JSON content (Default value) application/xml for XML content application/octet-stream for raw languageprint content |
{ "languageprint": "<Base64 Data>" }
<?xml version="1.0" encoding="UTF-8"?> <languageprint>[Base64 Data]</languageprint>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary @"languageprint.json" "SERVER_ADDRESS:PORT/technologies/languageid/lpinfo"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $languageprint = array( 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8qzP4VnD0DzFY8/tRL1vqXvgj9mQYVAe3yxP821nsBsRWhAzcorwFqk/T9YfX6/qhjqPqlHzL8Npc492V68PhtATT66GEO/DOO0P4rJEkDXu+S/Bpj1vpXy0j6syd0++Iyzv9+lkcDn1zJA6gW2v5JLmL/GU7s/ZoDKPw0yzT+k9AW+evFmP3tL277ggq+/UxatP7Q3v78WlmDAhz2BvyPc0rzCS5a/OruTv3K7iT/bJKm/Yxs9v4+ECUCeRpQ/ThgPPm42mD7lAfk/jBV3v+roPEAdnEdAA1kkvnx2/b8F1w0/wclOwHx317+HKPi/EQx9vWt96L5PL8w/to2VP+yqdz96Day/23V2P4o1KEAgMyTAiDgCPnlwv79dt5i/000ewHRWoz+mO+y+u1MsQKIuIUCCHqC+PKCBv6Q/lj8ZJN6/TTq1vnu4jz/rFuM/fqpXP9KidMDX/6C/+aLTP68/QMDRRZe/ylmZP1uX274WA0C/DR+8P7DvPsB9TbS+x/FAPs05A0Bw4EzAfeirP1AOrj9DYhs+AGIfv7SUVj+HMaS/xIP8v7tp376/Dx1AW+3OP1bcLkBK6L89WtFxv3dgNT+AC6i/GiljwPmphL9vL4o/Ljt2QELduD9xowI+cuKPv5C2378=' ); $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: application/json', 'content' => json_encode($languageprint), 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/lpinfo", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "LanguagePrintInfoResult", "languageprint_info": [ { "index": 0, "version": 511, "speech_length": 26.35, "user_data": "<Base64 encoded user data>" } ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>LanguagePrintInfoResult</name> <languageprint_info> <item> <index>0</index> <version>511</version> <speech_length>26.35</speech_length> <user_data>[Base64 encoded user data]</user_data> </item> ... </languageprint_info> </result> |
400Bad Request |
|
401Unauthorized |
|
Returns the list of language models for the specified technology model.
A list of language models can be used for training new language packs.
See POST /technologies/languageid/languagepacks/{name}
See also Usage examples - Language Identification - Create custom language model for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of LID technology model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/languageid/languagemodels?model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "L4"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagemodels?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "LanguageModelsResult", "model": "L4", "builtin_language_models": [ "am-ET", "ar-EG", ... ], "custom_language_models": [ "Custom-model-1", "Custom-model-2", ... ] } } <?xml version='1.0' encoding='UTF-8'?> <result> <version>1</version> <name>LanguageModelsResult</name> <model>L4</model> <builtin_language_models> <item>am-ET</item> <item>ar-EG</item> ... </builtin_language_models> <custom_language_models> <item>Custom-model-1</item> <item>Custom-model-2</item> ... </custom_language_models> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Returns information about language model.
See also Usage examples - Language Identification - Create custom language model for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of language model. |
model | query | string | yes | Name of LID technology model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/languageid/languagemodels/custom-language-model?model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "L4"; $LANGUAGE_MODEL = "custom-language-model"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagemodels/$LANGUAGE_MODEL?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "LanguageModelInfoResult", "model": "L4", "language_model": { "name": "custom-language-model", "files": [ { "name": "en-US.lpa", "type": "language-print-archive", "language_print_archive_info": { "file_size": 320968720 } }, { "name": "001.lp", "type": "language-print", "language_print_info": [ { "index": 1, "version": 511, "speech_length": 119.49997, "user_data": "<Base64 encoded user data>" } ... ] } ] } } } <?xml version='1.0' encoding='UTF-8'?> <result> <version>1</version> <name>LanguageModelInfoResult</name> <model>L4</model> <language_model> <name>custom-language-model</name> <files> <item> <name>en-US.lpa</name> <type>language-print-archive</type> <language_print_archive_info> <file_size>320968720</file_size> </language_print_archive_info> </item> <item> <name>001.lp</name> <type>language-print</type> <language_print_info> <item> <index>1</index> <version>511</version> <speech_length>119.49997</speech_length> <user_data>[Base64 encoded user data]</user_data> </item> ... </language_print_info> </item> </files> </language_model> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Create empty language model.
See also Usage examples - Language Identification - Create custom language model for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of language model. |
model | query | string | yes | Name of LID technology model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/technologies/languageid/languagemodels/custom-language-model?model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "L4"; $LANGUAGE_MODEL = "custom-language-model"; $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagemodels/$LANGUAGE_MODEL?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
Delete language model.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of language model. |
model | query | string | yes | Name of LID technology model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/languageid/languagemodels/custom-language-model?model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "L4"; $LANGUAGE_MODEL = "custom-language-model"; $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagemodels/$LANGUAGE_MODEL?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Dowload file from language model. Note that query parameter path here does not refer to the location on the server, but it is the name of your file within the language model. Therefore, the name of the file should not contain any slash characters ('/').
See also Usage examples - Language Identification - Create custom language model for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of language model. |
model | query | string | yes | Name of LID technology model. |
path | query | string | yes | Name of uploaded file. File must have extension .lp or .lpa. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/languageid/languagemodels/custom-language-model/file?path=001.lp&model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "001.lp"; $MODEL = "L4"; $LANGUAGE_MODEL = "custom-language-model"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagemodels/$LANGUAGE_MODEL/file?path=$PATH&model=$MODEL", false, $context ); file_put_contents("./$PATH", $response); //= file saved on the PHP server ?>
HTTP Status | Output |
---|---|
200OK | BINARY DATA |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Upload new file to language model. If the file already exists it is overwritten. The language model must exists. Note that query parameter path here does not refer to the location on the server, but it is the name of your file within the language model. Therefore, the name of the file should not contain any slash characters ('/').
See also Usage examples - Language Identification - Create custom language model for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of language model. |
model | query | string | yes | Name of LID technology model. |
path | query | string | yes | Name of uploaded file. File must have extension .lp or .lpa. |
BINARY LANGUAGE PRINT DATA (*.lp file/Decoded <Base64 Data>)
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST --data-binary @"LANGUAGE_PRINT" "SERVER_ADDRESS:PORT/technologies/languageid/languagemodels/custom-language-model/file?path=001.lp&model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "001.lp"; $MODEL = "L4"; $LANGUAGE_MODEL = "custom-language-model"; $language_print = file_get_contents("./001.lp"); //= path to the source file on the client $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: application/octet-stream', 'content' => $language_print, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagemodels/$LANGUAGE_MODEL/file?path=$PATH&model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "LanguageModelFileInfoResult", "model": "L4", "file": { "name": "5_engl.lp", "type": "language-print", "language_print_info": [ { "index": 0, "version": 511, "speech_length": 61.33, "user_data": "" } ] } } } <?xml version='1.0' encoding='UTF-8'?> <result> <version>1</version> <name>LanguageModelFileInfoResult</name> <model>L4</model> <file> <name>5_engl.lp</name> <type>language-print</type> <language_print_info> <item> <index>0</index> <version>511</version> <speech_length>61.33</speech_length> <user_data/> </item> </language_print_info> </file> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
413Request Entity Too Large |
|
415Unsupported Media Type |
|
Delete file in language model. Note that query parameter path here does not refer to the location on the server, but it is the name of your file within the language model. Therefore, the name of the file should not contain any slash characters ('/').
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of language model. |
model | query | string | yes | Name of LID technology model. |
path | query | string | yes | Name of deleted file. File must have extension .lp or .lpa. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/languageid/languagemodels/custom-language-model/file?path=001.lp&model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "001.lp"; $MODEL = "L4"; $LANGUAGE_MODEL = "custom-language-model"; $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagemodels/$LANGUAGE_MODEL/file?path=$PATH&model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
415Unsupported Media Type |
|
Returns list of language packs for specific model for language identification.
See also Usage examples - Language Identification - Create language pack for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of LID model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/languageid/languagepacks?model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "L4"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagepacks?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "LanguageIdentificationPacksResult", "language_packs": [ "default" ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>LanguageIdentificationPacksResult</name> <language_packs> <item>default</item> </language_packs> </result> |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Returns the list of languages in specific language pack for language identification.
See also Usage examples - Language Identification - Create language pack for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of language pack. |
model | query | string | yes | Name of LID model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/languageid/languagepacks/default?model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "L4"; $LANGUAGE_PACK = "default"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagepacks/$LANGUAGE_PACK?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 2, "name": "LanguageIdentificationPackResult", "language_pack": "default", "model": "L4", "languages": [ "am-ET", "arb", ... ], "metafiles": [ { "name": "abc.txt", "last_modified": "2021-02-10T08:37:40Z", "created": "2021-02-10T08:37:40Z", "size": 4, "is_directory": false, "is_registered": true }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>2</version> <name>LanguageIdentificationPackResult</name> <language_pack>default</language_pack> <model>L4</model> <languages> <item>am-ET</item> <item>arb</item> ... </languages> <metafiles> <item> <name>abc.txt</name> <last_modified>2021-02-10T08:37:40Z</last_modified> <created>2021-02-10T08:37:40Z</created> <size>4</size> <is_directory>false</is_directory> <is_registered>true</is_registered> </item> ... </metafiles> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Create a new language pack from available language models and register language pack to the system. Each language contains a name and a list of language models. A multiple of language models can be used to create a combined language. At least 2 languages must be specified. Use GET /technologies/languageid/languagemodels to get list of available language models.
With successfuly created language pack comes metafile report which allows to additionaly check, from which languages this language pack was created. You can retrive this metafile by endpoint GET /technologies/languageid/languagepacks/{name}/metafile and specify name of the metafile report.
Example report metafile content:
{ "version": 1, "languages":[ { "name":"English", "builtin_language_models":[ { "name":"en-US", "files":[ { "name":"en-US.lpa", "hash":"bdb042b6bf6d30d4" }, ... ] } ], "custom_language_models":[ ... ] }, { "name":"es-ES-enhanced", "builtin_language_models":[ { "name":"es-ES", "files":[ { "name":"es-ES.lpa", "hash":"f781a98b61f441b3" }, ... ] } ], "custom_language_models":[ { "name":"custom-es-model", "files":[ { "name":"001.lp", "hash":"06f90fe7c1ba00ae" }, ... ] } ] }, ... ] }
Report attributes description
languages[] | list of all languages that were used for creation of LPack |
---|---|
languages[]->name | language name |
languages[]->builtin_language_models[] | builtin language models |
languages[]->custom_language_models[] | custom language models |
Attributes of language models
languages[]->builtin_language_models[] and languages[]->custom_language_models[]
name | name of the language model |
---|---|
files[] | list of files that were used in training of this model |
files[]->name | filename |
files[]->hash | 64 bit hash computed by the xxHash algorithm. It allows to identify the file even if it was renamed or moved to another directory. Some Linux package managers provide utility xxhsum which reads and checks xxHash checksums of files. |
See also Usage examples - Language Identification - Create language pack for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of language pack. |
model | query | string | yes | Name of LID model. |
{ "languages": [ { "name": "English", "builtin_language_models": [ "en-US", ... ], "custom_language_models": [ ... ] }, { "name": "Enhanced spanish", "builtin_language_models": [ "es-ES", ... ], "custom_language_models": [ "custom-es-model" ] }, ... ] }
<?xml version="1.0" encoding="UTF-8"?> <languages> <item> <name>English</name> <builtin_language_models> <item> en-US </item> ... </builtin_language_models> <custom_language_models> ... </custom_language_models> </item> <item> <name>es-ES-enhanced</name> <builtin_language_models> <item> es-ES </item> ... </builtin_language_models> <custom_language_models> <item> custom-es-model </item> </custom_language_models> </item> ... </languages>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" --data-binary @"languagepack_data.json" -X POST "SERVER_ADDRESS:PORT/technologies/languageid/languagepacks/new_lpack?model=L4"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var content = { "languages": [ { "name": "English", "builtin_language_models": [ "en-US" ], "custom_language_models": [] }, { "name": "Enhanced spanish", "builtin_language_models": [ "es-ES" ], "custom_language_models": [ "custom-es-model" ] } ] } var options = { method: 'POST', content: content, uri_path: '/technologies/languageid/languagepacks/new_lpack', uri_params: { model: 'L4', }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Remove an existing language pack. Language pack default is not possible to delete via this endpoint.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of language pack. |
model | query | string | yes | Name of LID model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/languageid/languagepacks/new_lpack?model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "L4"; $LANGUAGE_PACK = "new_lpack"; $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagepacks/$LANGUAGE_PACK?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Downloads a metafile from an Language Pack. The The metafile is determined by the path parameter. Note that the path parameter in the request does not refer to the location of the metafile on the server, but it is the name of the metafile within the Language Pack. Therefore the name of the metafile should not contain any slashes ('/').
See also Usage examples - Language Identification - Create language pack for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the Language Pack. |
model | query | string | yes | Name of LID model. |
path | query | string | yes | Name of the metafile in the Language Pack. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/languageid/languagepacks/LANGUAGE_PACK_NAME/metafile?model=L4&path=METAFILE"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "METAFILE"; //= path to the meta file on the Phonexia Speech Engine $MODEL = "L4"; $LANGUAGE_PACK_NAME = "test"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagepacks/$LANGUAGE_PACK_NAME/metafile?model=$MODEL&path=$PATH", false, $context ); file_put_contents('./METAFILE', $response); //= audio file saved on the PHP server ?>
HTTP Status | Output |
---|---|
200OK | METADATA |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Uploads a metafile to Language Pack. The request body contains the metafile data. Note that the path parameter in the request does not refer to the location of the metafile on the server, but it is the name of the metafile within the Language Pack. Therefore the name of the metafile should not contain any slashes ('/').
See also Usage examples - Language Identification - Create language pack for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the Language Pack. |
model | query | string | yes | Name of LID model. |
path | query | string | yes | Name of the metafile in the Language Pack. |
metafile
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST --data-binary "@FILE_PATH" "SERVER_ADDRESS:PORT/technologies/languageid/languagepacks/LANGUAGE_PACK_NAME/metafile?model=L4&path=METAFILE"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "METAFILE"; //= destination path to the meta file on the Phonexia Speech Engine $MODEL = "L4"; $LANGUAGE_PACK_NAME = "test"; $content = file_get_contents("./METAFILE"); //= path to the source file on the PHP server $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: text/plain', 'content' => $content, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagepacks/$LANGUAGE_PACK_NAME/metafile?model=$MODEL&path=$PATH", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
413Request Entity Too Large |
|
Remove metafile from Language Pack. The metafile is determined by the path parameter. Note that the path parameter in the request does not refer to the location of the metafile on the server, but it is the name of the metafile within the Language Pack. Therefore the name of the metafile should not contain any slashes ('/').
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the Language Pack. |
model | query | string | yes | Name of LID model. |
path | query | string | yes | Name of the metafile in the Language Pack. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/languageid/languagepacks/LANGUAGE_PACK_NAME/metafile?model=L4&path=METAFILE"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "METAFILE"; //= path to the meta file on the Phonexia Speech Engine $MODEL = "L4"; $LANGUAGE_PACK_NAME = "test"; $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagepacks/$LANGUAGE_PACK_NAME/metafile?model=$MODEL&path=$PATH", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Register language pack to the system. Registration is necessary only when language pack files were manually copied to the server file system without using a proper API request (see POST /technologies/languageid/languagepacks/{name} or POST /technologies/languageid/languagepacks/{name}/file).
Language pack files have to be placed into the server file system according to the following template:
{SERVER_PATH}/home/{USER_NAME}/data/lid/languagepack/{TECHNOLOGY_MODEL}/{LANGUAGE_PACK_NAME}/mlr
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of language pack. |
model | query | string | yes | Name of LID model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/technologies/languageid/languagepacks/LPACK_NAME/registration?model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "L4"; $LANGUAGE_PACK = "LPACK_NAME"; $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagepacks/$LANGUAGE_PACK/registration?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
This function unregisters the language pack from the system. All associated results are removed, but language pack files itself stays in the filesystem.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of language pack. |
model | query | string | yes | Name of LID model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/languageid/languagepacks/LPACK_NAME?model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $MODEL = "L4"; $LANGUAGE_PACK = "LPACK_NAME"; $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/languageid/languagepacks/$LANGUAGE_PACK/registration?model=$MODEL", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
Speaker Identification 4 compares a recording with either a speaker model or speaker group. A speaker model consists of recordings of one speaker. A speaker group consists of several speaker models. Optionally, an Audio Source Profile can be used for the analyzed recording (parameter audio_source_profile_1) as well as for the speaker model / group (parameter audio_source_profile_2) to ensure that the results are optimized for your data. This request is asynchronous (see Asynchronous request).
See also Usage examples - Speaker Identification 4 - process recording for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file. |
model | query | string | yes | Name of the SID4 model. |
speaker_model | query | string | yes if group is not specified | Name of the speaker model. |
group | query | string | yes if speaker_model is not specified | Determines the speaker group. To select all speaker models use the virtual group "all". |
audio_source_profile_1 | query | string | no | Name of the Audio Source Profile for the recording. If the profile name starts with a '/' symbol it is taken as a path in the storage. In that case, the result is not saved to the cache. See Usage examples for more information. |
audio_source_profile_2 | query | string | no | Name of the Audio Source Profile for the speaker model (or speaker group). If the profile name starts with a '/' symbol it is taken as a path in the storage. In that case, the result is not saved to the cache. See Usage examples for more information. |
cache_only | query | boolean | no | If true, cache_only ensures that the result is returned only if it is already in the cache (the result is stored in the cache if the file has already been processed by the technology). If the result isn't in the cache yet, 404 status is returned. This parameter is not mandatory and if it is not set by the user, the recording is processed by the given technology automatically if the result is not already in the cache. Parameters cache_only and cache_disable can not be used together. |
cache_disable | query | boolean | no | If true, the result cache is disabled. cache_disable ensures that the recording is always processed and the result is not stored in the cache. Parameters cache_only and cache_disable can not be used together. |
from_time | query | double | no | from_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed from the beginning. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
to_time | query | double | no | to_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed to the end. Using this parameter causes that the result is not saved to the cache. Time is given in seconds. |
min_score_threshold | query | float | false | Only scores above and equal to this threshold will be sent back to client. Using this parameter disables cache. |
max_score_threshold | query | float | false | Only scores below and equal to this threshold will be sent back to client. Using this parameter disables cache. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4?path=julia.wav&model=L4&group=group1&audio_source_profile_1=test_profile_1&audio_source_profile_2=test_profile_2"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/speakerid4', uri_params: { path: '/julia.wav', model: 'L4', group: 'group1', audio_source_profile_1: 'test_profile_1', audio_source_profile_2: 'test_profile_2' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "SpeakerIdentification4MultiResult", "model": "L4", "speaker_group": "group1", "time_range": { "from_time": 2.5, "to_time": 5.5 }, "results": [ { "file": "julia_1.wav", "speaker_model": "test1", "audio_source_profile_1": "test_profile_1", "audio_source_profile_2": "test_profile_2", "channel_scores": [ { "channel": 0, "scores": [ { "score": 15.753671 } ] } ] }, { "file": "julia_1.wav", "speaker_model": "test2", "audio_source_profile_1": "test_profile_1", "audio_source_profile_2": "test_profile_2", "channel_scores": [ { "channel": 0, "scores": [ { "score": -14.8087845 } ] } ] } ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>SpeakerIdentification4MultiResult</name> <model>L4</model> <speaker_group>group1</speaker_group> <time_range> <from_time>2.5</from_time> <to_time>5.5</to_time> </time_range> <results> <item> <file>julia_1.wav</file> <speaker_model>test1</speaker_model> <audio_source_profile_1>test_profile_1</audio_source_profile_1> <audio_source_profile_2>test_profile_2</audio_source_profile_2> <channel_scores> <item> <channel>0</channel> <scores> <item> <score>15.753671</score> </item> </scores> </item> </channel_scores> </item> <item> <file>julia_1.wav</file> <speaker_model>test2</speaker_model> <audio_source_profile_1>test_profile_1</audio_source_profile_1> <audio_source_profile_2>test_profile_2</audio_source_profile_2> <channel_scores> <item> <channel>0</channel> <scores> <item> <score>-14.8087845</score> </item> </scores> </item> </channel_scores> </item> </results> </result> Result description
Results array item description
Channel score item description
| ||||||||||||||||||||||||
400Bad Request |
| ||||||||||||||||||||||||
401Unauthorized |
| ||||||||||||||||||||||||
404Not Found |
| ||||||||||||||||||||||||
405Method Not Allowed |
| ||||||||||||||||||||||||
406Not Acceptable |
| ||||||||||||||||||||||||
415Unsupported Media Type |
|
Speaker Identification 4 compares a voiceprint with a speaker model or speaker group. A speaker model consists of recordings of one speaker. A speaker group consists of several speaker models. The speaker model or speaker group has to be prepared first (see speaker model or groups)
It is necessary to use the same SID4 model for processing as the SID4 model used for voiceprint extraction otherwise the server returns HTTP error 500.
Optionally, an Audio Source Profile for analyzed voceprint (parameter audio_source_profile_1) and for speaker model / group (audio_source_profile_2) can be specified, to ensure that provided system results are the best for your data. This request is asynchronous (see Asynchronous request).See also Usage examples - Speaker Identification 4 - process recording for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of the SID4 model. |
speaker_model | query | string | yes if group is not specified | Name of the speaker model. |
group | query | string | yes if speaker_model is not specified | Determines the speaker group. To select all speaker models use the virtual group "all". |
audio_source_profile_1 | query | string | false | Name of the Audio Source Profile for the analyzed voiceprint. If the profile name starts with a '/' symbol it is taken as a path in the storage. See Usage examples for more information. |
audio_source_profile_2 | query | string | false | Name of the Audio Source Profile for the speaker model (or speaker group). If the profile name starts with a '/' symbol it is taken as a path in the storage. See Usage examples for more information. |
min_score_threshold | query | float | false | Only scores above and equal to this threshold will be sent back to client. Using this parameter disables cache. |
max_score_threshold | query | float | false | Only scores below and equal to this threshold will be sent back to client. Using this parameter disables cache. |
Content-Type | header | string | yes | application/json for JSON content (Default value) application/xml for XML content application/octet-stream for raw voiceprint content |
{ "voiceprint": "<Base64 Data>" }
<?xml version="1.0" encoding="UTF-8"?> <voiceprint>[Base64 Data]</voiceprint>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary @"voiceprint.json" "SERVER_ADDRESS:PORT/technologies/speakerid4?model=L4&group=group1&audio_source_profile_1=test_profile_1&audio_source_profile_2=test_profile_2"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/technologies/speakerid4', uri_params: { model: 'L4', group: 'group1', audio_source_profile_1: 'test_profile_1', audio_source_profile_2: 'test_profile_2' }, content: { "voiceprint": "VlBUIP4BAACJCQAAAAgAAAAAAAAHyZdwk4qWvwNxD8A6LFW/DMgPwGj+CUCC8kfAGGZlv+4djr+A9OG/yU08wPOfLMBdIA8/UwB2P6rCGcCTbDDA/CoAwN+IF8DEfhdAhgAswN12L8CN5iQ/mWWBwMlukMBtsXzAnTQqwP5Ntz8vWTfAb7N1vU+lCECt3InAcXinvxPb6j5Mv0HARHgzvzT4nD8sphpArDjWv0qpaD+W5p0/1T7RvyTvNsCOpdW/02r1v/sOur/o1jxA0E2ov1aUV8AGWwPAnAnrvyRJsb/OjQNAJ55hwER2PMB4JLc/e1C+Pz4b1r2nITTAwALzPnhxuj84LwbAehiDQMISKsA+ZIS/I2DEv9R0kz/O+RPARHRfQFoHXT9eIq2/pNMDQMI/FEDqtCjAvXZBwO+ATsClLE9AfHzhu+5CgL+c/njANobSP1sutz/IMGh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0mX8Bnvu8/6P+tviXLH7/fnQbAiAoZQJQagMC3FXTAPphEPvrvIcDIMDNAatxiwDsnMcB9eUzAv4wswO8cjD4xRVbAn7kZwH6fVb7NeRW/mM7Ov1RWh7+VfzhAEGeFPyOwV70Xp1zAy252wE/qVD/dlhs/QZt1P2FN9b4=" }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "SpeakerIdentification4MultiResult", "model": "L4", "speaker_group": "group1", "results": [ { "file": "{voiceprint}", "speaker_model": "test1", "audio_source_profile_1": "test_profile_1", "audio_source_profile_2": "test_profile_2", "channel_scores": [ { "channel": 0, "scores": [ { "score": 15.753671 } ] } ] }, { "file": "{voiceprint}", "speaker_model": "test2", "audio_source_profile_1": "test_profile_1", "audio_source_profile_2": "test_profile_2", "channel_scores": [ { "channel": 0, "scores": [ { "score": -14.8087845 } ] } ] } ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>SpeakerIdentification4MultiResult</name> <model>S</model> <speaker_group>group1</speaker_group> <results> <item> <file>{voiceprint}</file> <speaker_model>test1</speaker_model> <audio_source_profile_1>test_profile_1</audio_source_profile_1> <audio_source_profile_2>test_profile_2</audio_source_profile_2> <channel_scores> <item> <channel>0</channel> <scores> <item> <score>15.753671</score> </item> </scores> </item> </channel_scores> </item> <item> <file>{voiceprint}</file> <speaker_model>test2</speaker_model> <audio_source_profile_1>test_profile_1</audio_source_profile_1> <audio_source_profile_2>test_profile_2</audio_source_profile_2> <channel_scores> <item> <channel>0</channel> <scores> <item> <score>-14.8087845</score> </item> </scores> </item> </channel_scores> </item> </results> </result> Result description
Results array item description
Channel score item description
| ||||||||||||||||||||||
400Bad Request |
| ||||||||||||||||||||||
401Unauthorized |
| ||||||||||||||||||||||
404Not Found |
| ||||||||||||||||||||||
405Method Not Allowed |
|
Get partial result from task analyzing input stream identified by task ID.
This request also can be used for registration of Webhook callback or WebSocket handshake.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Input stream Task ID |
interval | query | double | no | Time interval (in seconds) used for delivery updates of task results via WebSocket or WebHook (it does not affect when using polling). The default value is 0, which ensures that results are delivered as soon as possible. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/input_stream?task=STREAM_TASK_ID"
HTTP Status | Output | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "SpeakerIdentification4InputStreamMultiResult", "model": "L4", "is_last": true, "task_id": "bfc641a4-37a4-4983-8276-5f63dcc70fd0", "task_execution_time": 19.28692, "input_stream_id": "6fdb15f6-4c01-48fc-ba4e-832c9da69acd", "speaker_group": "all", "utterance_length": 9.9, "min_utterance_length_limit": 0, "results": [ { "file": "", "speaker_model": "david_1", "audio_source_profile_1": "", "audio_source_profile_2": "", "channel_scores": [ { "channel": 0, "scores": [ { "score": 14.225391 } ] } ] }, { "file": "", "speaker_model": "david_2", "audio_source_profile_1": "", "audio_source_profile_2": "", "channel_scores": [ { "channel": 0, "scores": [ { "score": 8.92917 } ] } ] }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>SpeakerIdentification4InputStreamMultiResult</name> <model>L4</model> <is_last>true</is_last> <task_id>dcae1de7-341e-40ac-a868-864e6f671181</task_id> <task_execution_time>6.008333</task_execution_time> <input_stream_id>1f693724-9183-45d7-8051-829887d47c75</input_stream_id> <speaker_group>all</speaker_group> <utterance_length>1.11</utterance_length> <min_utterance_length_limit>0</min_utterance_length_limit> <results> <item> <file/> <speaker_model>david_1</speaker_model> <audio_source_profile_1></audio_source_profile_1> <audio_source_profile_2></audio_source_profile_2> <channel_scores> <item> <channel>0</channel> <scores> <item> <score>2.6890395</score> </item> </scores> </item> </channel_scores> </item> <item> <file/> <speaker_model>david_2</speaker_model> <audio_source_profile_1></audio_source_profile_1> <audio_source_profile_2></audio_source_profile_2> <channel_scores> <item> <channel>0</channel> <scores> <item> <score>1.9447069</score> </item> </scores> </item> </channel_scores> </item> ... </results> </result> Result description
Results array item description
Channel score item description
| ||||||||||||||||||||||||||||||||||
400Bad Request |
| ||||||||||||||||||||||||||||||||||
401Unauthorized |
| ||||||||||||||||||||||||||||||||||
404Not Found |
| ||||||||||||||||||||||||||||||||||
405Method Not Allowed |
|
Start analyzing input stream identified by stream ID. Speaker identification compares audio from input stream with specified speaker model or speaker group - a voiceprint is extracted (internally, in the background) from the incoming stream audio and the voiceprint is compared to the speaker model or speaker group.
By default, speech from all incoming audio (since the start of the analysis) is used for creation of the internal voiceprint.
If the floating_window parameter is used, only the last N seconds of speech from incoming audio is used for creation of the internal voiceprint;
this feature is useful for detecting changes of speaker over time (NOTE: the recommended value is 5 seconds; using lower values may produce unreliable results, using higher values prolongs the reaction time to speaker change).
When both speaker model (speaker_model) and speaker group (group) parameters are omitted, then getting result by GET /technologies/speakerid4/input_stream is not possible but it is still possible to obtain current voiceprint by GET /technologies/speakerid4/input_stream/voiceprint.
Note that since SPE 3.32.0 it is suggested to use POST /technologies/speakerid4/input_stream/voiceprint for voiceprint results
Speaker model consists of recordings of one speaker. Speaker group consists of several speaker models. Speaker model and Speaker group have to be prepared before analyzing starts (see PUT /technologies/speakerid4/speakermodels/{name}/prepare and PUT /technologies/speakerid4/groups/{name}/prepare). Prepare requests requires Speaker Identification 4 VoicePrint Extractor (SID4E) technology.
Optionally, an Audio Source Profile can be used for the analyzed input stream (parameter audio_source_profile_1) as well as for the speaker model / group (parameter audio_source_profile_2) to ensure that the results are optimized for your data.
This technology can not be attached to multichannel input stream.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
input_stream | query | string | yes | Input stream ID which the request will be attached to |
model | query | string | yes | Name of SID4 model. |
speaker_model | query | string | no | Name of the speaker model. |
group | query | string | no | Determines the speaker group. For select all speaker models use virtual group "all". |
floating_window | query | double | no | Voiceprint will be extracted only from last N seconds of speech if the parameter is set. The value must be greater than 0.0. The recommended value is 5 seconds. Using lower values may produce unreliable results, using higher values prolongs the reaction time to speaker change. |
audio_source_profile_1 | query | string | no | Name of the Audio Source Profile for the input stream. If the profile name starts with a '/' symbol it is taken as a path in the storage. |
audio_source_profile_2 | query | string | no | Name of the Audio Source Profile for the speaker model (or speaker group). If the profile name starts with a '/' symbol it is taken as a path in the storage. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/technologies/speakerid4/input_stream?input_stream=STREAM_ID&model=L4&group=GROUP_NAME"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "UserStreamTaskInfoResult", "stream_task_info": { "id": "8506180c-e87d-42f6-ac9a-c5ca3a3a3202", "state": "running", "input_stream_id": "29eae856-0004-46a2-a761-9e9a72bad719" } } } <result> <version>1</version> <name>UserStreamTaskInfoResult</name> <stream_task_info> <id>8506180c-e87d-42f6-ac9a-c5ca3a3a3202</id> <state>running</state> <input_stream_id>29eae856-0004-46a2-a761-9e9a72bad719</input_stream_id> </stream_task_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
503Service Unavailable |
|
Note that SID4C_STREAM is not required if both speaker_model and group parameters are omitted.
Stop task analyzing input stream identified by task ID.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Input stream Task ID which the request will be attached to |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/speakerid4/input_stream?task=STREAM_TASK_ID"
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Get current voiceprint from input stream identified by task ID.
Result voiceprint (result->voiceprint) may be empty string until first data are processed.
This request also can be used for registration of Webhook callback or WebSocket handshake.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Input stream Task ID |
interval | query | double | no | Time interval (in seconds) used for delivery updates of task results via WebSocket or WebHook (it does not affect when using polling). The default value is 0, which ensures that results are delivered as soon as possible. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/input_stream/voiceprint?task=STREAM_TASK_ID"
HTTP Status | Output | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200OK | JSONXML{ "result": { "version": 4, "name": "SpeakerIdentification4VoiceprintInputStreamResult", "model": "L4", "is_last": false, "task_id": "bfc641a4-37a4-4983-8276-5f63dcc70fd0", "task_execution_time": 19.28692, "input_stream_id": "6fdb15f6-4c01-48fc-ba4e-832c9da69acd", "voiceprint": <Base64 Data>, "speech_length": 12.7 } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>4</version> <name>SpeakerIdentification4VoiceprintInputStreamResult</name> <model>L4</model> <is_last>false</is_last> <task_id>bfc641a4-37a4-4983-8276-5f63dcc70fd0</task_id> <task_execution_time>19.28692</task_execution_time> <input_stream_id>6fdb15f6-4c01-48fc-ba4e-832c9da69acd</input_stream_id> <voiceprint>[Base64 Data]</voiceprint> <speech_length>12.7</speech_length> </result> Result description
| ||||||||||||||
400Bad Request |
| ||||||||||||||
401Unauthorized |
| ||||||||||||||
404Not Found |
| ||||||||||||||
405Method Not Allowed |
|
Start voiceprint extraction from input stream identified by stream ID.
By default, speech from all incoming audio (since the start of the analysis) is used for creation of the voiceprint.
If the floating_window parameter is used, only the last N seconds of speech from incoming audio is used for creation of the voiceprint;
this feature is useful for detecting changes of speaker over time (NOTE: the recommended value is 5 seconds; using lower values may produce unreliable results, using higher values prolongs the reaction time to speaker change).
This technology can not be attached to multichannel input stream.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
input_stream | query | string | yes | Input stream ID which the request will be attached to |
model | query | string | yes | Name of SID4 model. |
floating_window | query | double | no | Voiceprint will be extracted only from last N seconds of speech if the parameter is set. The value must be greater than 0.0. The recommended value is 5 seconds. Using lower values may produce unreliable results, using higher values prolongs the reaction time to speaker change. |
voiceprint_backward_compatibility | query | bool | no | Applicable only to XL5 model, ignored for other models. If enabled, the extracted voiceprint will contain also XL4-compatible part. Such voiceprint can be then compared with either XL5, or XL4 voiceprints. NOTE: Voiceprint with the XL4-compatible part is bigger than voiceprint with only XL5 part (3 KiB vs. 2 KiB). |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/technologies/speakerid4/input_stream/voiceprint?input_stream=STREAM_ID&model=L4"
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "UserStreamTaskInfoResult", "stream_task_info": { "id": "8506180c-e87d-42f6-ac9a-c5ca3a3a3202", "state": "running", "input_stream_id": "29eae856-0004-46a2-a761-9e9a72bad719" } } } <result> <version>1</version> <name>UserStreamTaskInfoResult</name> <stream_task_info> <id>8506180c-e87d-42f6-ac9a-c5ca3a3a3202</id> <state>running</state> <input_stream_id>29eae856-0004-46a2-a761-9e9a72bad719</input_stream_id> </stream_task_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
503Service Unavailable |
|
Stop task analyzing input stream identified by task ID.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
task | query | string | yes | Input stream Task ID which the request will be attached to |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/speakerid4/input_stream/voiceprint?task=STREAM_TASK_ID"
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Extracts the voiceprint from an audio file. A resulted voiceprint is not saved to the cache. This request is asynchronous (see Asynchronous request).
Voiceprint size: L4: 2 KiB, XL4: 1 KiB, XL5: 2-3 KiB (see voiceprint_backward_compatibility parameter)
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
path | query | string | yes | Server path to the audio file. |
model | query | string | yes | Name of the SID4 model. |
from_time | query | double | no | from_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed from the beginning. Time is given in seconds. |
to_time | query | double | no | to_time specifies the time range of the recording to be processed. If the parameter is not specified or equals "0" the recording is processed to the end. Time is given in seconds. |
voiceprint_backward_compatibility | query | bool | no | Applicable only to XL5 model, ignored for other models.
If enabled, the extracted voiceprint will contain also XL4-compatible part. Such voiceprint can be then compared with either XL5, or XL4 voiceprints. NOTE: Voiceprint with the XL4-compatible part is bigger than voiceprint with only XL5 part (3 KiB vs. 2 KiB). |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/extractvp?path=julia_1.wav&model=L4"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/speakerid4/extractvp', uri_params: { path: '/julia.wav', model: 'L4', }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | The time_range parameter in the output is serialized only when query parameters from_time or to_time are specified.
voiceprint_set may contains more than one voiceprint when input recording is multi-channel. Each voiceprint is extracted from one channel, and voiceprint_set is sorted by channel order. JSONXML{ "result": { "version": 3, "name": "SpeakerIdentification4VoiceprintResult", "file": "\/kelly_julia.wav", "model": "L4", "time_range": { "from_time": 2.5, "to_time": 5.5 }, "voiceprint_set": [ { "voiceprint": <Base64 Data>, "speech_length": 12.7 }, { "voiceprint": <Base64 Data>, "speech_length": 24.8 }, ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>SpeakerIdentification4VoiceprintResult</name> <file>/kelly_julia.wav</file> <model>L4</model> <time_range> <from_time>2.5</from_time> <to_time>5.5</to_time> </time_range> <voiceprint_set> <item> <voiceprint>[Base64 Data]</voiceprint> <speech_length>12.7</speech_length> </item> <item> <voiceprint>[Base64 Data]</voiceprint> <speech_length>24.8</speech_length> </item> ... </voiceprint_set> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
406Not Acceptable |
|
415Unsupported Media Type |
|
Compares two voiceprints. This request is asynchronous (see Asynchronous request).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content |
model | query | string | yes | Name of the SID4 model. |
audio_source_profile_1 | query | string | no | Name of the Audio Source Profile for the first voiceprint. If the profile name starts with a '/' symbol it is taken as a path in the storage. |
audio_source_profile_2 | query | string | no | Name of the Audio Source Profile for the second voiceprint. If the profile name starts with a '/' symbol it is taken as a path in the storage. |
{ "voiceprints": [ <Base64 Data>, <Base64 Data> ] }
<?xml version="1.0" encoding="UTF-8"?> <voiceprints> <item> [Base64 Data] </item> <item> [Base64 Data] </item> </voiceprints>
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST -H "Content-Type:application/json" --data-binary @"voiceprints.json" "SERVER_ADDRESS:PORT/technologies/speakerid4/comparevp?model=L4&audio_source_profile_1=test_profile_1&audio_source_profile_2=test_profile_2"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/technologies/speakerid4/comparevp', uri_params: { model: 'L4', audio_source_profile_1: 'test_profile_1', audio_source_profile_2: 'test_profile_2' }, content: { "voiceprints": [ "VlBUIAcAAAD9CAAA6AMAAAAAAAD3vHKT8LtfPk373b\/gMhG\/BAyNvXDZjD86XH0\/0FyCP1e6iD8zjba+OAAgv\/Jj3z0TL54+bm+0PiwUVb\/g6ErAE7jXPos6Mb8xYRy\/UEcAQGgoZT8eb+Q\/oGxIP88EBT5YrYY\/8WqWP\/0WrD\/xa44\/lomHP+yqjz+soYI\/RRgZPdoFtj9ZCmQ\/qKIEP7nuhL4Bl4O\/g9kJv1\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ucWvWJk2j\/Nky4\/ez+EP2CWyb9Dc4U\/6aQpP+hPiD6UwE++7AS6P4dQB8BMOmc\/Qbu4Pz77U77SVoc\/6BcFP2afCz9ZbSi\/+z6UPzLRh72G2cM\/t9mPvuWDcr9qRFE+S5UcQDvrxj+PrpA\/5uOdv3vcSz+R2Aw\/12WUvCScIb\/vxJO\/8++tP2I4gr5fUkM\/vGqCv\/hcB0BLT8y9aX6ov9kOLT5koZW\/6ehyvep6pjyVJ6O\/vfRoPmoOab8R6vk\/biEAP6EDA0BQ+1g+Yq2+vyEjNUAxb4W\/xo5SP3w4nL7caIu+l+LqP14XPL4Ocdm+miuiP43SnD9BJFLAsHSrvwelOL17B7C\/yRbTvirTZT\/a7x+\/JxTpPWf6aT0mlmO\/85AgP4rLmj9cw6K\/zZChP\/ym6T4W3jA\/ligQwPF7n7\/Ewj0\/yK+gPhrjL78IKYY+H2jpP3gncj05e5++GHcrP3vK\/L4usla+ZFMDvVho4r4w2Ls\/lEfVP9p\/nL6mvdu\/gyGDvg==" ] }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "SpeakerIdentification4MultiResult", "model": "L4", "speaker_group": "", "results": [ { "file": "", "speaker_model": "", "audio_source_profile_1": "profile_test_1", "audio_source_profile_2": "profile_test_2", "channel_scores": [ { "channel": 0, "scores": [ { "score": 13.249981 } ] } ] } ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>SpeakerIdentification4MultiResult</name> <model>L4</model> <speaker_group/> <results> <item> <file/> <speaker_model/> <audio_source_profile_1>test_profile_1</audio_source_profile_1> <audio_source_profile_2>test_profile_2</audio_source_profile_2> <channel_scores> <item> <channel>0</channel> <scores> <item> <score>13.249981</score> </item> </scores> </item> </channel_scores> </item> </results> </result> Result description
Results array item description
Channel score item description
| ||||||||||||||||||||||
400Bad Request |
| ||||||||||||||||||||||
401Unauthorized |
| ||||||||||||||||||||||
404Not Found |
| ||||||||||||||||||||||
405Method Not Allowed |
|
Compares the voiceprint set with itself. This request is asynchronous (see Asynchronous request).
The request body must contain only one voiceprint set.
To compare two different voiceprint sets use POST /technologies/speakerid4/comparevpsets
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content |
model | query | string | yes | Name of the SID4 model. |
prune_matrix | query | string | no | above (results above and on diagonal will be 0) below (results below and on diagonal will be 0) |
audio_source_profile | query | string | no | Name of the Audio Source Profile. If the profile name starts with a '/' symbol it is taken as a path in the storage. |
{ "voiceprint_set": [ { "voiceprint": <Base64 Data> }, { "voiceprint": <Base64 Data> }, ... ] }
<?xml version="1.0" encoding="UTF-8"?> <voiceprint_set> <item> <voiceprint>[Base64 Data]</voiceprint> </item> <item> <voiceprint>[Base64 Data]</voiceprint> </item> ... </voiceprint_set>
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST -H "Content-Type:application/json" --data-binary @"voiceprint_set.json" "SERVER_ADDRESS:PORT/technologies/speakerid4/comparevpset?model=L4&audio_source_profile=test_profile"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/technologies/speakerid4/comparevpset', uri_params: { model: 'L4', audio_source_profile: 'test_profile' }, content: { "voiceprint_set": [ { "voiceprint": "VlBUIAcAAAD9CAAA6AMAAAAAAAD3vHKT8LtfPk373b\/gMhG\/BAyNvXDZjD86XH0\/0FyCP1e6iD8zjba+OAAgv\/Jj3z0TL54+bm+0PiwUVb\/g6ErAE7jXPos6Mb8xYRy\/UEcAQGgoZT8eb+Q\/oGxIP88EBT5YrYY\/8WqWP\/0WrD\/xa44\/lomHP+yqjz+soYI\/RRgZPdoFtj9ZCmQ\/qKIEP7nuhL4Bl4O\/g9kJv1\/erb8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rTCrAWucWvWJk2j\/Nky4\/ez+EP2CWyb9Dc4U\/6aQpP+hPiD6UwE++7AS6P4dQB8BMOmc\/Qbu4Pz77U77SVoc\/6BcFP2afCz9ZbSi\/+z6UPzLRh72G2cM\/t9mPvuWDcr9qRFE+S5UcQDvrxj+PrpA\/5uOdv3vcSz+R2Aw\/12WUvCScIb\/vxJO\/8++tP2I4gr5fUkM\/vGqCv\/hcB0BLT8y9aX6ov9kOLT5koZW\/6ehyvep6pjyVJ6O\/vfRoPmoOab8R6vk\/biEAP6EDA0BQ+1g+Yq2+vyEjNUAxb4W\/xo5SP3w4nL7caIu+l+LqP14XPL4Ocdm+miuiP43SnD9BJFLAsHSrvwelOL17B7C\/yRbTvirTZT\/a7x+\/JxTpPWf6aT0mlmO\/85AgP4rLmj9cw6K\/zZChP\/ym6T4W3jA\/ligQwPF7n7\/Ewj0\/yK+gPhrjL78IKYY+H2jpP3gncj05e5++GHcrP3vK\/L4usla+ZFMDvVho4r4w2Ls\/lEfVP9p\/nL6mvdu\/gyGDvg==" } ] }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200OK | Example of a result matrix without using parameter prune_matrix JSONXML
{ "result": { "version": , "name": SpeakerIdentification4VoiceprintSetsCompareResult", "model": L4", "audio_source_profile_1": "profile_test", "audio_source_profile_2": "profile_test", "matrix": [ [ <vp1 x vp1>, <vp1 x vp2>, ..., <vp1 x vpN> ], [ <vp2 x vp1>, <vp2 x vp2>, ..., <vp2 x vpN> ], ..., [ <vpN x vp1>, <vpN x vp2>, ..., <vpN x vpN> ] ] } } <?xml version='1.0' encoding='UTF-8'?> <result> <version>1</version> <name>SpeakerIdentification4VoiceprintSetsCompareResult</name> <model>L4</model> <audio_source_profile_1>profile_test</audio_source_profile_1> <audio_source_profile_2>profile_test</audio_source_profile_2> <matrix> <item> <item>[vp1 x vp1]</item> <item>[vp1 x vp2]</item> ... <item>[vp1 x vpN]</item> </item> <item> <item>[vp2 x vp1]</item> <item>[vp2 x vp2]</item> ... <item>[vp2 x vpN]</item> </item> ... <item> <item>[vpN x vp1]</item> <item>[vpN x vp2]</item> ... <item>[vpN x vpN]</item> </item> ... </matrix> </result> | ||||||||||||||||||||||||||||||||||||||||||||||||
400Bad Request |
| ||||||||||||||||||||||||||||||||||||||||||||||||
401Unauthorized |
| ||||||||||||||||||||||||||||||||||||||||||||||||
404Not Found |
| ||||||||||||||||||||||||||||||||||||||||||||||||
405Method Not Allowed |
|
Compares two voiceprint sets with each other. This request is asynchronous (see Asynchronous request).
The request body should contain two voiceprint sets.
To compare one voiceprint set to itself use POST /technologies/speakerid4/comparevpset
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content |
model | query | string | yes | Name of the SID4 model. |
audio_source_profile_1 | query | string | no | Name of the Audio Source Profile for the first voiceprint. If the profile name starts with a '/' symbol it is taken as a path in the storage. |
audio_source_profile_2 | query | string | no | Name of the Audio Source Profile for the second voiceprint set. If the profile name starts with a '/' symbol it is taken as a path in the storage. |
{ "voiceprint_sets": [ { "voiceprint_set": [ { "voiceprint": <Base64 Data> }, { "voiceprint": <Base64 Data> }, ... ] }, { "voiceprint_set": [ { "voiceprint": <Base64 Data> }, { "voiceprint": <Base64 Data> }, ... ] } ] }
<?xml version="1.0" encoding="UTF-8"?> <voiceprint_sets> <item> <voiceprint_set> <item> <voiceprint>[Base64 Data]</voiceprint> </item> <item> <voiceprint>[Base64 Data]</voiceprint> </item> ... </voiceprint_set> </item> <item> <voiceprint_set> <item> <voiceprint>[Base64 Data]</voiceprint> </item> <item> <voiceprint>[Base64 Data]</voiceprint> </item> ... </voiceprint_set> </item> </voiceprint_sets>
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST -H "Content-Type:application/json" --data-binary @"voiceprint_sets.json" "SERVER_ADDRESS:PORT/technologies/speakerid4/comparevpsets?model=L4&audio_source_profile_1=test_profile_1&audio_source_profile_2=test_profile_2"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/technologies/speakerid4/comparevpsets', uri_params: { model: 'L4', audio_source_profile_1: 'test_profile_1', audio_source_profile_2: 'test_profile_2' }, content: { "voiceprint_sets": [ { "voiceprint_set": [ { "voiceprint": "VlBUIAcAAAD9CAAA6AMAAAAAAAD3vHKT8LtfPk373b\/gMhG\/BAyNvXDZjD86XH0\/0FyCP1e6iD8zjba+OAAgv\/Jj3z0TL54+bm+0PiwUVb\/g6ErAE7jXPos6Mb8xYRy\/UEcAQGgoZT8eb+Q\/oGxIP88EBT5YrYY\/8WqWP\/0WrD\/xa44\/lomHP+yqjz+soYI\/RRgZPdoFtj9ZCmQ\/qKIEP7nuhL4Bl4O\/g9kJv1\/erb8gA1q+CsSRPzNga78qMo6\/kISNvwykbD9P+Jq\/zUWGPiVKAUDwvIq\/E6yPv8WYpr\/SpAa\/wbaJvXgpHL4QwJu95Wk5Pj5mXb7n8+49Xz2bPy3SSj+6Uvw+5ZgDP\/Fqsb\/KgiC+yadGP4lmFj53iwE\/ZpeRP9SwOD9tQWU+8yKRvW8RFz\/Jryy\/pgQnvxN4zb6GCCs\/rmQiP51l3z4hRp0\/JVOYv+oVE76B6gM+oLErv6imh7war3E\/zS\/OP4BF0r\/QAZA+IMgEPvM5hj\/dWYg+HRa5P+RkMr9I0rY+MEdWPrifzL+vmBi\/ihuNvjjj4b8yzEI\/17JnP78GvT9ZSgG\/rNqbvwD6Iz66ZRlAguRbPjwv9T7OE5o\/ok6Lvhdso79bJO+\/noI5vz\/xWb+Udvi8cfAdP3b6pD440NS+tTUdwMhpAjxSTH+\/DjDJPT4Lez2b7y0\/o3IY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P3gncj05e5++GHcrP3vK\/L4usla+ZFMDvVho4r4w2Ls\/lEfVP9p\/nL6mvdu\/gyGDvg==" } ] } ] }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200OK | Example result matrix:
{ "result": { "version": 1, "name": "SpeakerIdentification4VoiceprintSetsCompareResult", "model": "L4", "audio_source_profile_1": "profile_test_1", "audio_source_profile_2": "profile_test_2", "matrix": [ [ <vpset1_vp1 x vpset2_vp1>, <vpset1_vp1 x vpset2_vp2>, ..., <vpset1_vp1 x vpset2_vpM>, ], [ <vpset1_vp2 x vpset2_vp1>, <vpset1_vp2 x vpset2_vp2> ..., <vpset1_vp2 x vpset2_vpM>, ], ..., [ <vpset1_vpN x vpset2_vp1>, <vpset1_vpN x vpset2_vp2> ..., <vpset1_vpN x vpset2_vpM>, ], ] } } <?xml version='1.0' encoding='UTF-8'?> <result> <version>1</version> <name>SpeakerIdentification4VoiceprintSetsCompareResult</name> <model>L4</model> <audio_source_profile_1>profile_test_1</audio_source_profile_1> <audio_source_profile_2>profile_test_2</audio_source_profile_2> <matrix> <item> <item>[vpset1_vp1 x vpset2_vp1]</item> <item>[vpset1_vp1 x vpset2_vp2]</item> ..., <item>[vpset1_vp1 x vpset2_vpN]</item> </item> <item> <item>[vpset1_vp2 x vpset2_vp1]</item> <item>[vpset1_vp2 x vpset2_vp2]</item> ..., <item>[vpset1_vp2 x vpset2_vpN]</item> </item> ..., <item> <item>[vpset1_vpN x vpset2_vp1]</item> <item>[vpset1_vpN x vpset2_vp2]</item> ..., <item>[vpset1_vpN x vpset2_vpM]</item> </item> </matrix> </result> | |||||||||||||||||||||||||
400Bad Request |
| |||||||||||||||||||||||||
401Unauthorized |
| |||||||||||||||||||||||||
403Forbidden |
| |||||||||||||||||||||||||
404Not Found |
| |||||||||||||||||||||||||
405Method Not Allowed |
|
Compares the voiceprint set with itself and cluster the voiceprints. This request is asynchronous (see Asynchronous request).
The request body must contain only one voiceprint set.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content |
model | query | string | yes | Name of the SID4 model. |
audio_source_profile | query | string | no | Name of the Audio Source Profile. If the profile name starts with a '/' symbol it is taken as a path in the storage. |
{ "voiceprint_set": [ { "voiceprint": <Base64 Data> }, { "voiceprint": <Base64 Data> }, ... ] }
<?xml version="1.0" encoding="UTF-8"?> <voiceprint_set> <item> <voiceprint>[Base64 Data]</voiceprint> </item> <item> <voiceprint>[Base64 Data]</voiceprint> </item> ... </voiceprint_set>
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST -H "Content-Type:application/json" --data-binary @"voiceprint_set.json" "SERVER_ADDRESS:PORT/technologies/speakerid4/clustervpset?model=L4&audio_source_profile=test_profile"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/technologies/speakerid4/clustervpset', uri_params: { model: 'L4', audio_source_profile: 'test_profile' }, content: { "voiceprint_set": [ { "voiceprint": "VlBUIAcAAAD9CAAA6AMAAAAAAAD3vHKT8LtfPk373b\/gMhG\/BAyNvXDZjD86XH0\/0FyCP1e6iD8zjba+OAAgv\/Jj3z0TL54+bm+0PiwUVb\/g6ErAE7jXPos6Mb8xYRy\/UEcAQGgoZT8eb+Q\/oGxIP88EBT5YrYY\/8WqWP\/0WrD\/xa44\/lomHP+yqjz+soYI\/RRgZPdoFtj9ZCmQ\/qKIEP7nuhL4Bl4O\/g9kJv1\/erb8gA1q+CsSRPzNga78qMo6\/kISNvwykbD9P+Jq\/zUWGPiVKAUDwvIq\/E6yPv8WYpr\/SpAa\/wbaJvXgpHL4QwJu95Wk5Pj5mXb7n8+49Xz2bPy3SSj+6Uvw+5ZgDP\/Fqsb\/KgiC+yadGP4lmFj53iwE\/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Odv3vcSz+R2Aw\/12WUvCScIb\/vxJO\/8++tP2I4gr5fUkM\/vGqCv\/hcB0BLT8y9aX6ov9kOLT5koZW\/6ehyvep6pjyVJ6O\/vfRoPmoOab8R6vk\/biEAP6EDA0BQ+1g+Yq2+vyEjNUAxb4W\/xo5SP3w4nL7caIu+l+LqP14XPL4Ocdm+miuiP43SnD9BJFLAsHSrvwelOL17B7C\/yRbTvirTZT\/a7x+\/JxTpPWf6aT0mlmO\/85AgP4rLmj9cw6K\/zZChP\/ym6T4W3jA\/ligQwPF7n7\/Ewj0\/yK+gPhrjL78IKYY+H2jpP3gncj05e5++GHcrP3vK\/L4usla+ZFMDvVho4r4w2Ls\/lEfVP9p\/nL6mvdu\/gyGDvg==" } ] }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "SpeakerIdentification4VoiceprintSetClustersResult", "model": "L4", "audio_source_profile": "profile_test", "clusters": [ { "members": [ 0, 4 ] }, { "members": [ 1, 2 ] }, { "members": [ 3 ] } ] } } <?xml version='1.0' encoding='UTF-8'?> <result> <version>1</version> <name>SpeakerIdentification4VoiceprintSetClustersResult</name> <model>L4</model> <audio_source_profile>profile_test</audio_source_profile> <clusters> <item> <members> <item>0</item> <item>4</item> </members> </item> <item> <members> <item>1</item> <item>2</item> </members> </item> <item> <members> <item>3</item> </members> </item> </clusters> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Returns information about the voiceprint posted in the request body. The voiceprint can contain multiple sub-voiceprints. For each sub-voiceprint the server returns version, speech_length (in seconds) and user_data (base64 encoded).
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | yes | application/json for JSON content (Default value) application/xml for XML content application/octet-stream for raw voiceprint content |
{ "voiceprint": "<Base64 Data>" }
<?xml version="1.0" encoding="UTF-8"?> <voiceprint>[Base64 Data]</voiceprint>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary @"voiceprint.json" "SERVER_ADDRESS:PORT/technologies/speakerid4/vpinfo"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $voiceprint = array( 'voiceprint' => 'VlBUIAcAAAD9CAAA6AMAAAAAAAD3vHKT8LtfPk373b/gMhG/BAyNvXDZjD86XH0/0FyCP1e6iD8zjba+OAAgv/Jj3z0TL54+bm+0PiwUVb/g6ErAE7jXPos6Mb8xYRy/UEcAQGgoZT8eb+Q/oGxIP88EBT5YrYY/8WqWP/0WrD/xa44/lomHP+yqjz+soYI/RRgZPdoFtj9ZCmQ/qKIEP7nuhL4Bl4O/g9kJv1/erb8gA1q+CsSRPzNga78qMo6/kISNvwykbD9P+Jq/zUWGPiVKAUDwvIq/E6yPv8WYpr/SpAa/wbaJvXgpHL4QwJu95Wk5Pj5mXb7n8+49Xz2bPy3SSj+6Uvw+5ZgDP/Fqsb/KgiC+yadGP4lmFj53iwE/ZpeRP9SwOD9tQWU+8yKRvW8RFz/Jryy/pgQnvxN4zb6GCCs/rmQiP51l3z4hRp0/JVOYv+oVE76B6gM+oLErv6imh7war3E/zS/OP4BF0r/QAZA+IMgEPvM5hj/dWYg+HRa5P+RkMr9I0rY+MEdWPrifzL+vmBi/ihuNvjjj4b8yzEI/17JnP78GvT9ZSgG/rNqbvwD6Iz66ZRlAguRbPjwv9T7OE5o/ok6Lvhdso79bJO+/noI5vz/xWb+Udvi8cfAdP3b6pD440NS+tTUdwMhpAjxSTH+/DjDJPT4Lez2b7y0/o3IYP8AHKT+rvRy/YLigvBGtfb/IUBe+KL3gv6mV2z+8g9G/tFXdPppkKb0NeQA/g/oJQPTrbjweV7M+rbJqv/IXv78oRE8+ET54v0uXs7/8TIi/RESXP48LjD8lN25AulqTv2LrtL/6J6W+5QRrv971Zb9S1hnA+t1TPzOJED5GOTe/di+6Pq7cQL/tLCk+5IsBPt3n374WlqG/t0Udvv9W9b8SyAo/p343vylLSb8z4UO/kttMv4ZwrD/d7Hq/WPo6Pz4bRz1kycM/AGA3O5DIZb7Eqjc/lYDnPejvH0D0d9G/wvvCv1bu3j5uhKI/CMK0PMX3RT9bUI2/OJnSPcBppr5sGd0+IYtIv6o4ar+oxyG+tXTMPqkCmD+ty6a/f+PyPmKR3r6ML+G/rNxevgvMED8bS4A/U/oevp6Nar+UPR0/1EYiwAovzj5O3ry/teVFPu9Nk781WUO/tQQ9QMQWGL+4LMe99A+hv/67SD7kfD7ApnkWv/TZnj4K2IE/JyOev5qAz75dJ2e/vp4Wv3OlXT8rO2a/Hiz2P3olHb3nLgO/uQpjP+02Rj8hGmg/tsi6PdKfKD/JHVQ/zPsHv9YZjL1eVTs/Y8Olv/kNez61bb6/7aICP9oqX7/2BDu+sIGevy/e+z4MwxQ+vThJvhqC4r84fdi/SvSJvw==' ); $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: application/json', 'content' => json_encode($voiceprint), 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/vpinfo", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "VoiceprintInfoResult", "voiceprint_info": [ { "index": 1, "version": 37, "speech_length": 119.49997, "user_data": "<Base64 encoded user data>" } ... ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>VoiceprintInfoResult</name> <voiceprint_info> <item> <index>1</index> <version>37</version> <speech_length>119.49997</speech_length> <user_data>[Base64 encoded user data]</user_data> </item> ... </voiceprint_info> </result> |
400Bad Request |
|
401Unauthorized |
|
Merges a set of voiceprints to a single new voiceprint. The new voiceprint is a combination of all voiceprints in the set. All voiceprints in the set have to be of the same SID4 model. It uses a weighted arithmetic mean. It is accomplished by weighting a particular voiceprint by its speech length. Keep in mind that the resulting voiceprint is not the same as the voiceprint extracted from a file created by concatenating all individual audio files into one, but it is very similar to it.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content |
{ "voiceprint_set": [ { "voiceprint": <Base64 Data> }, { "voiceprint": <Base64 Data> }, ... ] }
<?xml version="1.0" encoding="UTF-8"?> <voiceprint_set> <voiceprint> [Base64 Data] </voiceprint> <voiceprint> [Base64 Data] </voiceprint> ... </voiceprint_set>
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST -H "Content-Type:application/json" --data-binary @"voiceprint_set.json" "SERVER_ADDRESS:PORT/technologies/speakerid4/vpmerge"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'POST', uri_path: '/technologies/speakerid4/vpmerge', content: { "voiceprint_set": [ { "voiceprint": "VlBUIAcAAAD9CAAA6AMAAAAAAAD3vHKT8LtfPk373b\/gMhG\/BAyNvXDZjD86XH0\/0FyCP1e6iD8zjba+OAAgv\/Jj3z0TL54+bm+0PiwUVb\/g6ErAE7jXPos6Mb8xYRy\/UEcAQGgoZT8eb+Q\/oGxIP88EBT5YrYY\/8WqWP\/0WrD\/xa44\/lomHP+yqjz+soYI\/RRgZPdoFtj9ZCmQ\/qKIEP7nuhL4Bl4O\/g9kJv1\/erb8gA1q+CsSRPzNga78qMo6\/kISNvwykbD9P+Jq\/zUWGPiVKAUDwvIq\/E6yPv8WYpr\/SpAa\/wbaJvXgpHL4QwJu95Wk5Pj5mXb7n8+49Xz2bPy3SSj+6Uvw+5ZgDP\/Fqsb\/KgiC+yadGP4lmFj53iwE\/ZpeRP9SwOD9tQWU+8yKRvW8RFz\/Jryy\/pgQnvxN4zb6GCCs\/rmQiP51l3z4hRp0\/JVOYv+oVE76B6gM+oLErv6imh7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yVJ6O\/vfRoPmoOab8R6vk\/biEAP6EDA0BQ+1g+Yq2+vyEjNUAxb4W\/xo5SP3w4nL7caIu+l+LqP14XPL4Ocdm+miuiP43SnD9BJFLAsHSrvwelOL17B7C\/yRbTvirTZT\/a7x+\/JxTpPWf6aT0mlmO\/85AgP4rLmj9cw6K\/zZChP\/ym6T4W3jA\/ligQwPF7n7\/Ewj0\/yK+gPhrjL78IKYY+H2jpP3gncj05e5++GHcrP3vK\/L4usla+ZFMDvVho4r4w2Ls\/lEfVP9p\/nL6mvdu\/gyGDvg==" } ] }, callback: function(result) { console.log(result); // work with result } };
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "VoiceprintMergeResult", "voiceprint": <Base64 Data>, "speech_length": 12.4 } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>VoiceprintMergeResult</name> <voiceprint>[Base64 Data]</voiceprint> <speech_length>12.4</speech_length> </result> |
400Bad Request |
|
401Unauthorized |
|
Benchmark the Speaker Identification 4 technology with the default set of recordings or a user-specified recording (by parameter path). Only speed of extraction is measured.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
model | query | string | yes | Name of Speaker Identification 4 technology model. |
path | query | string | no | Server path to the audio file. If not specified, default recordings will be used. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/benchmark?model=L4"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example * * JavaScript code: */ var options = { method: 'GET', uri_path: '/technologies/speakerid/benchmark', uri_params: { model: 'L4' }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "SpeakerIdentification4BenchmarkResult", "dataset_version": "1.0", "model_name": "S", "benchmark_result": { "processed_length": 21.31999969482422, "processing_time": 0.48091199999999995, "faster_than_realtime": 44.549944615190896 }, "cpu_info": { "vendor": "GenuineIntel", "brand": "Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz", "n_cores": 4, "n_logical_cores": 4, "l1_data_cache": 32768, "l1_instruction_cache": 32768, "l2_cache": 262144, "l3_cache": 6291456 }, "memory_info": { "total_ram": 16623747072, "free_ram": 5028855808, "total_swap": 0, "free_swap": 0 } } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>SpeakerIdentification4BenchmarkResult</name> <dataset_version>1.0</dataset_version> <model_name>S</model_name> <benchmark_result> <processed_length>21.31999969482422</processed_length> <processing_time>0.48091199999999995</processing_time> <faster_than_realtime>44.549944615190896</faster_than_realtime> </benchmark_result> <cpu_info> <vendor>GenuineIntel</vendor> <brand>Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz</brand> <n_cores>4</n_cores> <n_logical_cores>4</n_logical_cores> <l1_data_cache>32768</l1_data_cache> <l1_instruction_cache>32768</l1_instruction_cache> <l2_cache>262144</l2_cache> <l3_cache>6291456</l3_cache> </cpu_info> <memory_info> <total_ram>16623747072</total_ram> <free_ram>4938498048</free_ram> <total_swap>0</total_swap> <free_swap>0</free_swap> </memory_info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Returns the list of speaker models and groups available for speaker identification. Speaker models and groups are shared by both SID and SID4.
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "SpeakerIdentificationModelsResult", "models": [ "model1", "model2" ], "groups": [ "all", "group1" ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>SpeakerIdentificationModelsResult</name> <models> <item>model1</item> <item>model2</item> </models> <groups> <item>all</item> <item>group1</item> </groups> </result> |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Returns the list of recordings and metafiles included in a speaker model. Speaker models are shared by both SID and SID4.
See also Usage examples - Speaker Identification 4 - prepare Speaker model or Group of speaker models for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Determines the speaker model name. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels/SPEAKER_MODEL_NAME"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $SPEAKER_MODEL_NAME = "test"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels/$SPEAKER_MODEL_NAME", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 5, "name": "SpeakerIdentificationModelInfo", "speaker_model": "model1", "is_ready": [ "S", "L" ], "is_calibrated": [ { "model": "S", "calibration_set": "calibset", "max_fa_rate": 0.1 } ], "member_of_groups": [ "all", "group1" ], "files": [ { "name": "david_1.wav", "last_modified": "2016-01-22T08:36:00Z", "created": "2016-01-22T08:36:00Z", "size": 492204, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 30.76, "n_channels": 1, "format": "lin16" } ], "metafiles": [ { "name": "david_1.txt", "last_modified": "2015-09-15T12:33:02Z", "created": "2015-09-15T12:33:02Z", "size": 100, "is_directory": false, "is_registered": true } ] } } <?xml version="1.0"?> <result> <version>5</version> <name>SpeakerIdentificationModelInfo</name> <speaker_model>model1</speaker_model> <is_ready> <item>S</item> <item>L</item> </is_ready> <is_calibrated> <item> <model>S</model> <calibration_set>calibset</calibration_set> <max_fa_rate>0.1</max_fa_rate> </item> </is_calibrated> <member_of_groups> <item>all</item> <item>group1</item> </member_of_groups> <files> <item> <name>david_1.wav</name> <last_modified>2016-01-22T08:36:00Z</last_modified> <created>2016-01-22T08:36:00Z</created> <size>492204</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>30.76</length> <n_channels>1</n_channels> <format>lin16</format> </item> </files> <metafiles> <item> <name>david_1.txt</name> <last_modified>2015-09-15T12:33:02Z</last_modified> <created>2015-09-15T12:33:02Z</created> <size>100</size> <is_directory>false</is_directory> <is_registered>true</is_registered> </item> </metafiles> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Creates a new empty speaker model. Speaker models are shared by both SID and SID4.
See also Usage examples - Speaker Identification 4 - prepare Speaker model or Group of speaker models for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Determines the speaker model name |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels/SPEAKER_MODEL_NAME"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $SPEAKER_MODEL_NAME = "test"; $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels/$SPEAKER_MODEL_NAME", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Removes a speaker model. All contained recordings, metafiles and related results are deleted. Speaker models are shared by both SID and SID4.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Determines the speaker model name. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels/SPEAKER_MODEL_NAME"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $SPEAKER_MODEL_NAME = "test"; $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels/$SPEAKER_MODEL_NAME", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Prepares the speaker model. It is necessary to prepare a speaker model before comparing it with voiceprints or using it in stream. A speaker model is prepared automatically when it is used in the GET /technologies/speakerid4 request. This request is asynchronous (see Asynchronous request).
See also Usage examples - Speaker Identification 4 - prepare Speaker model or Group of speaker models for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the speaker model. |
model | query | string | yes | Name of the SID4 model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X PUT "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels/SPEAKERMODEL_NAME/prepare?model=L4"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example */ var speakermodel_name = 'test'; var options = { method: 'PUT', uri_path: '/technologies/speakerid4/speakermodels/' + speakermodel_name + '/prepare', uri_params: { model: 'L4', }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
406Not Acceptable |
|
Downloads recording from a speaker model. Specific recording is determined by the path parameter. Note that query parameter path here does not refer to the location of the recording on server, but it is the name of your recording within the speaker model. Therefore, the name of the recording should not contain any slash characters ('/').
See also Usage examples - Speaker Identification 4 - prepare Speaker model or Group of speaker models for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the speaker model. |
path | query | string | yes | Name of recording in speaker model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels/SPEAKER_MODEL_NAME/audiofile?path=AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= path to the audio file on the Phonexia Speech Engine $SPEAKER_MODEL_NAME = "test"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels/$SPEAKER_MODEL_NAME/audiofile?path=$PATH", false, $context ); file_put_contents('./audio.wav', $response); //= audio file saved on the PHP server ?>
HTTP Status | Output |
---|---|
200OK | AUDIO DATA |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Uploads audio file to speaker model. The request body contains audio file data. Speaker model is automatically created if it does not exist. Note that query parameter path here does not refer to the location of the recording on server, but it is the name of your recording within the speaker model. Therefore, the name of the recording should not contain any slash characters ('/').
See also Usage examples - Speaker Identification 4 - prepare Speaker model or Group of speaker models for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the speaker model. |
path | query | string | yes | Name of recording in speaker model. |
AUDIO DATA
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST --data-binary "@FILE_PATH" "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels/SPEAKER_MODEL_NAME/audiofile?path=AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= destination path to the audiofile on the Phonexia Speech Engine $SPEAKER_MODEL_NAME = "test"; $audio = file_get_contents("./audio.wav"); //= path to the source file on the PHP server $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: audio/wav', 'content' => $audio, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels/$SPEAKER_MODEL_NAME/audiofile?path=$PATH", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioFileInfoResult", "info": { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioFileInfoResult</name> <info> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
403Forbidden |
|
405Method Not Allowed |
|
413Request Entity Too Large |
|
415Unsupported Media Type |
|
Removes recording from speaker model. Recording is determined by the path parameter. Note that query parameter path here does not refer to the location of the recording on server, but it is the name of your recording within the speaker model. Therefore, the name of the recording should not contain any slash characters ('/'), as it has no effect on the recording location in server's storage.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the speaker model. |
path | query | string | yes | Name of recording in speaker model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels/SPEAKER_MODEL_NAME/audiofile?path=AUDIO_FILE.wav"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/AUDIO_FILE.wav"; //= path to the audio file on the Phonexia Speech Engine $SPEAKER_MODEL_NAME = "test"; $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels/$SPEAKER_MODEL_NAME/audiofile?path=$PATH", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Downloads a metafile from a speaker model. The metafile is determined by the path parameter. Note that the parameter path in the request does not refer to the location of the metafile on the server, but it is the name of the metafile within the speaker model. Therefore, the name of the metafile must not contain any slashes ('/').
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the speaker model. |
path | query | string | yes | Name of metafile in speaker model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels/SPEAKER_MODEL_NAME/metafile?path=METAFILE"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/METAFILE"; //= path to the meta file on the Phonexia Speech Engine $SPEAKER_MODEL_NAME = "test"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels/$SPEAKER_MODEL_NAME/metafile?path=$PATH", false, $context ); file_put_contents('./METAFILE', $response); //= audio file saved on the PHP server ?>
HTTP Status | Output |
---|---|
200OK | METADATA |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Uploads a metafile to a speaker model. The request body contains the metafile data. Note that the parameter path in the request does not refer to the location of the metafile on the server, but it is the name of the metafile within the speaker model. Therefore, the name of the metafile must not contain any slashes ('/').
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the speaker model. |
path | query | string | yes | Name of the metafile in speaker model. |
metafile
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST --data-binary "@FILE_PATH" "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels/SPEAKER_MODEL_NAME/metafile?path=METAFILE"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/METAFILE"; //= destination path to the meta file on the Phonexia Speech Engine $SPEAKER_MODEL_NAME = "test"; $audio = file_get_contents("./METAFILE"); //= path to the source file on the PHP server $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: audio/wav', 'content' => $audio, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels/$SPEAKER_MODEL_NAME/metafile?path=$PATH", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
413Request Entity Too Large |
|
Removes a metafile from a speaker model. The metafile is determined by the path parameter. Note that the parameter path in the request does not refer to the location of the metafile on the server, but it is the name of the metafile within the speaker model. Therefore, the name of the metafile must not contain any slashes ('/').
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the speaker model. |
path | query | string | yes | Name of the metafile in speaker model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels/SPEAKER_MODEL_NAME/metafile?path=METAFILE"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $PATH = "/METAFILE"; //= path to the meta file on the Phonexia Speech Engine $SPEAKER_MODEL_NAME = "test"; $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels/$SPEAKER_MODEL_NAME/metafile?path=$PATH", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioFileInfoResult", "info": { "name": "julia_1.wav", "last_modified": "2015-08-03T08:16:15Z", "created": "2015-08-03T08:16:15Z", "size": 474444, "is_directory": false, "is_registered": true, "frequency": 8000, "length": 29.65, "n_channels": 1, "format": "lin16" } } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioFileInfoResult</name> <info> <name>julia_1.wav</name> <last_modified>2015-08-03T08:16:15Z</last_modified> <created>2015-08-03T08:16:15Z</created> <size>474444</size> <is_directory>false</is_directory> <is_registered>true</is_registered> <frequency>8000</frequency> <length>29.65</length> <n_channels>1</n_channels> <format>lin16</format> </info> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Gets a voiceprint from a prepared speaker model. The speaker model can be prepared by calling PUT /technologies/speakerid4/speakermodels/{name}/prepare
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the speaker model. |
model | query | string | yes | Name of the SID4 model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/speakermodels/kelly/voiceprint?model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $SPEAKER_MODEL_NAME = "kelly"; $TECHNOLOGY_MODEL = "L4"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels/$SPEAKER_MODEL_NAME/voiceprint?model=$TECHNOLOGY_MODEL", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "SpeakerModelVoiceprintResult", "speaker_model": "kelly", "model": "L", "voiceprint": <Base64 Data>, "speech_length": 12.4 } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>3</version> <name>SpeakerModelVoiceprintResult</name> <speaker_model>kelly</speaker_model> <model>L</model> <voiceprint>[Base64 Data]</voiceprint> <speech_length>12.4</speech_length> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Returns information about a speaker model group.
See also Usage examples - Speaker Identification 4 - prepare Speaker model or Group of speaker models for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the speaker model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/groups/SPEAKER_GROUP_NAME"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $SPEAKER_GROUP_NAME = "test"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/groups/$SPEAKER_GROUP_NAME", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "SpeakerIdentificationGroupResult", "group": "group1", "is_ready": [ "S", "L" ], "is_calibrated": [ { "model": "S", "calibration_set": "calibset", "max_fa_rate": 0.1 } ], "speaker_models": [ "model1", "model2", ... ] } } <result> <version>3</version> <name>SpeakerIdentificationGroupResult</name> <group>group1</group> <is_ready> <item>S</item> <item>L</item> </is_ready> <is_calibrated> <item> <model>S</model> <calibration_set>calibset</calibration_set> <max_fa_rate>0.1</max_fa_rate> </item> ... </is_calibrated> <speaker_models> <item>model1</item> <item>model2</item> ... </speaker_models> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Creates a new empty speaker model group.
See also Usage examples - Speaker Identification 4 - prepare Speaker model or Group of speaker models for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the speaker model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X POST "SERVER_ADDRESS:PORT/technologies/speakerid4/groups/SPEAKER_GROUP_NAME"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $SPEAKER_GROUP_NAME = "test"; $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/groups/$SPEAKER_GROUP_NAME", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Removes an existing speaker model group.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of the speaker model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X DELETE "SERVER_ADDRESS:PORT/technologies/speakerid4/groups/SPEAKER_GROUP_NAME"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $SPEAKER_GROUP_NAME = "test"; $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/speakermodels/$SPEAKER_GROUP_NAME", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Specifies the existing speaker model(s) to be included in a speaker group. If the speaker group does not exist, it is automatically created. If the speaker group already exists, it gets overwritten. It is possible to set the Content-Type parameter in the request header, which is helpful in case the client wants to send input data in XML format.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content |
name | path | string | yes | Name of the speaker model. |
{ "speaker_models": [ "speaker_1", "speaker_2", ... ] }
<?xml version="1.0" encoding="UTF-8"?> <speaker_models> <item>speaker_1</item> <item>speaker_2</item> ... </speaker_models>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X POST --data-binary "@speaker_models.json" "SERVER_ADDRESS:PORT/technologies/speakerid4/groups/SPEAKER_GROUP_NAME/speakermodel"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $SPEAKER_GROUP_NAME = "test"; $speakers = array( 'speaker_models' => array ( "speaker_1", "speaker_2" ) ); $options = array( 'http' => array ( 'method' => 'POST', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: application/json', 'content' => json_encode($speakers), 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/groups/$SPEAKER_GROUP_NAME/speakermodel", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Adds existing speaker model(s) into an existing speaker group. It is possible to set the Content-Type parameter in the request header which is helpful in case the client wants to send input data in XML format.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content |
name | path | string | yes | Name of the speaker model. |
{ "speaker_models": [ "speaker_1", "speaker_2", ... ] }
<?xml version="1.0" encoding="UTF-8"?> <speaker_models> <item>speaker_1</item> <item>speaker_2</item> ... </speaker_models>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X PUT --data-binary "@speaker_models.json" "SERVER_ADDRESS:PORT/technologies/speakerid4/groups/SPEAKER_GROUP_NAME/speakermodel"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $SPEAKER_GROUP_NAME = "test"; $speakers = array( 'speaker_models' => array ( "speaker_1", "speaker_2" ) ); $options = array( 'http' => array ( 'method' => 'PUT', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: application/json', 'content' => json_encode($speakers), 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/groups/$SPEAKER_GROUP_NAME/speakermodel", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Removes speaker model(s) from a speaker group. The request body contains a list of speaker models to be removed from the speaker group. It is possible to set the Content-Type parameter in the request headerwhich is helpful in case the client wants to send input data in XML format.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
Content-Type | header | string | no | application/json for JSON content (Default value) application/xml for XML content |
name | path | string | yes | Name of the speaker model. |
{ "speaker_models": [ "speaker_1", "speaker_2", ... ] }
<?xml version="1.0" encoding="UTF-8"?> <speaker_models> <item>speaker_1</item> <item>speaker_2</item> ... </speaker_models>
curl -H "X-SessionID:YOUR_SESSION_ID" -H "Content-Type:application/json" -X DELETE --data-binary "@speaker_models.json" "SERVER_ADDRESS:PORT/technologies/speakerid4/groups/SPEAKER_GROUP_NAME/speakermodel"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $SPEAKER_GROUP_NAME = "test"; $speakers = array( 'speaker_models' => array ( "speaker_1", "speaker_2" ) ); $options = array( 'http' => array ( 'method' => 'DELETE', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID . "\r\n" . 'Content-Type: application/json', 'content' => json_encode($speakers), 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/groups/$SPEAKER_GROUP_NAME/speakermodel", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
405Method Not Allowed |
|
Prepares a group of speaker models. It is necessary to prepare a group before comparing voiceprints with it.
The group is prepared automatically when used in the GET /technologies/speakerid4 request.
This request is asynchronous (see Asynchronous request).
See also Usage examples - Speaker Identification 4 - prepare Speaker model or Group of speaker models for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of group. |
model | query | string | yes | Name of the SID4 model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X PUT "SERVER_ADDRESS:PORT/technologies/speakerid4/groups/GROUP_NAME/prepare?model=L4"
/* * See above to chapter Asynchronous request - Example: PHP + JS Asynchronous request example * * There is specific options applicable for async_request() method from PHP + JS Example */ var group_name = 'test'; var options = { method: 'PUT', uri_path: '/technologies/speakerid4/groups/' + group_name + '/prepare', uri_params: { model: 'L4', }, callback: function(result) { console.log(result); // work with result } }; async_request(options);
HTTP Status | Output |
---|---|
200OK | |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
406Not Acceptable |
|
Returns the list of voiceprints of all speaker models belonging to the speaker group. All speaker models must be prepared first. A speaker model can be prepared by calling PUT /technologies/speakerid4/speakermodels/{name}/prepare. All speaker models in a group can be prepared by calling PUT /technologies/speakerid4/groups/{name}/prepare.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Name of speaker group. |
model | query | string | yes | Name of the SID4 model. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/groups/group1/voiceprints?model=L4"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $SPEAKER_GROUP_NAME = "group1"; $TECHNOLOGY_MODEL = "L4"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/groups/$SPEAKER_GROUP_NAME/voiceprints?model=$TECHNOLOGY_MODEL", false, $context ); $matches = array(); preg_match('/HTTP\/\d+\.\d+ (\d+)/', $http_response_header[0], $matches); $http_code = $matches[1]; if($http_code == 200) { // OK } ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "SpeakerGroupVoiceprintsResult", "speaker_group": "group1", "model": "L", "voiceprint_set": [ { "speaker_model": "kelly", "voiceprint": <Base64 Data>, "speech_length": 12.4 }, { "speaker_model": "julia", "voiceprint": <Base64 Data>, "speech_length": 24.8 }, ... ] } } <?xml version='1.0' encoding='UTF-8'?> <result> <version>3</version> <name>SpeakerGroupVoiceprintsResult</name> <speaker_group>group1</speaker_group> <model>L</model> <voiceprint_set> <item> <speaker_model>kelly</speaker_model> <voiceprint>[Base64 Data]</voiceprint> <speech_length>12.4</speech_length> </item> <item> <speaker_model>julia</speaker_model> <voiceprint>[Base64 Data]</voiceprint> <speech_length>24.8</speech_length> </item> ... </voiceprint_set> </result> |
400Bad Request |
|
401Unauthorized |
|
404Not Found |
|
405Method Not Allowed |
|
Returns the list of Audio Source Profiles for Speaker Identification 4.
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/audiosourceprofiles"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/audiosourceprofiles", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 1, "name": "AudioSourceProfilesResult", "audio_source_profiles": [ { "name": "Profile1", "hash": "ffecae4fedd92147992a77e7f555d113a012c5bb9b26e1a0f4537ba77affab4d", "model": "L4" }, { "name": "Profile2", "hash": "bae838c29f979f9f56214a8e0e318d342d26cbf13248c4db451c7314983dcf98", "model": "L4" } ] } } <?xml version="1.0" encoding="UTF-8"?> <result> <version>1</version> <name>AudioSourceProfilesResult</name> <audio_source_profiles> <item> <name>Profile1</name> <hash>bae838c29f979f9f56214a8e0e318d342d26cbf13248c4db451c7314983dcf98</hash> <model>L4</model> </item> <item> <name>Profile2</name> <hash>bae838c29f979f9f56214a8e0e318d342d26cbf13248c4db451c7314983dcf98</hash> <model>L4</model> </item> </audio_source_profiles> </result> |
400Bad Request |
|
401Unauthorized |
|
Returns details about an Audio Source Profile
See also Usage examples - Speaker Identification 4 - prepare Audio Source Profile for more information.
Name | Parameter Type | Data Type | Required | Description |
---|---|---|---|---|
name | path | string | yes | Determines the Audio Source Profile. |
curl -H "X-SessionID:YOUR_SESSION_ID" -X GET "SERVER_ADDRESS:PORT/technologies/speakerid4/audiosourceprofiles/AUDIO_SOURCE_PROFILE_NAME"
<?php /** * Set variables according to your server. */ $SERVER_ADDRESS = 'http://127.0.0.1'; $PORT = 8600; $YOUR_SESSION_ID = '39db96cc-f11e-4d34-afae-33635cf9c4c1'; //= get it from login request $AUDIO_SOURCE_PROFILE_NAME = "test"; $options = array( 'http' => array ( 'method' => 'GET', 'header' => 'X-SessionID: ' . $YOUR_SESSION_ID, 'ignore_errors' => true, ) ); $context = stream_context_create( $options ); $response = file_get_contents( "$SERVER_ADDRESS:$PORT/technologies/speakerid4/audiosourceprofiles/$AUDIO_SOURCE_PROFILE_NAME", false, $context ); $response = json_decode( $response ); var_dump($response); /** Work with $response **/ ?>
HTTP Status | Output |
---|---|
200OK | JSONXML{ "result": { "version": 3, "name": "AudioSourceProfileInfo", "audio_source_profile_name": "ProfileName", "model": "L4", "voiceprint_count": 1000, "voiceprint_versions": [ 520, 530 ] "hash": "ffecae4fedd92147992a77e7f555d113a012c5bb9b26e1a0f4537ba77affab4d", "parent_hash": "bae838c29f979f9f56214a8e0e318d342d26cbf13248c4db451c7314983dcf98", "is_hash_valid": true, "user_comment": "My user comment", "created": "2019-01-22T08:36:00Z", "size": 14285714, "false_acceptance_calibration": { "max_false_acceptance_rate": 1.5, "enabled": true }, "user_calibration": { "scale": 1.2, "shift": 1.8, "enabled": false }, "mean_normalization": { "enabled": true }, "metafiles": [ { "name": "metafile_1.txt", "last_modified": "2015-09-15T12:33:02Z", "created": "2015-09-15T12:33:02Z", "size": 100, "is_directory": false, "is_registered": true } ] } } <?xml version="1.0"?> <result> <version>3</version> <name>AudioSourceProfileInfo</name> <audio_source_profile_name>ProfileName</audio_source_profile_name> <model>L4</model> <voiceprint_count>1000</voiceprint_count> <voiceprint_versions> <item>520</item> <item>530</item> </voiceprint_versions> <hash>ffecae4fedd92147992a77e7f555d113a012c5bb9b26e1a0f4537ba77affab4d</hash> <parent_hash>bae838c29f979f9f56214a8e0e318d342d26cbf13248c4db451c7314983dcf98</parent_hash> <is_hash_valid>true</is_hash_valid> <user_comment>My user comment</user_comment> <created>2019-01-22T08:36:00Z</created> <size>14285714</size> <false_acceptance_calibration> <false_acceptance_calibration>1.5</false_acceptance_calibration> <enabled>true</enabled> </false_acceptance_calibration> <user_calibration> <scale>1.2</scale> <shift>1.8</shift> <enabled>false</enabled> </user_calibration> <mean_normalization> <enabled>true</enabled> </mean_normalization> <metafiles> <item> <name>metafile_1.txt</name> <last_modified>2015-09-15T12:33:02Z</last_modified> <created>2015-09-15T12:33:02Z</created> <size>100</size> <is_directory>false</is_directory> <is_registered>true</is_registered> </item> </metafiles> </result> |
400Bad Request |