Test

<back to all web services

SpeechToText

AI

Convert speech to text

"use strict";
export class TextOutput {
    /** @param {{text?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {?string}
     * @description The generated text */
    text;
}
export class TextGenerationResponse {
    /** @param {{results?:TextOutput[],responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {?TextOutput[]}
     * @description List of generated text outputs */
    results;
    /**
     * @type {?ResponseStatus}
     * @description Detailed response status information */
    responseStatus;
}
export class SpeechToText {
    /** @param {{audio?:string,refId?:string,tag?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description The audio stream containing the speech to be transcribed */
    audio;
    /**
     * @type {?string}
     * @description Optional client-provided identifier for the request */
    refId;
    /**
     * @type {?string}
     * @description Tag to identify the request */
    tag;
}

JavaScript SpeechToText DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /jsv/reply/SpeechToText HTTP/1.1 
Host: test.servicestack.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	audio: String,
	refId: String,
	tag: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	results: 
	[
		{
			text: String
		}
	],
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}