POST /speech/asrlongrunning
Performs asynchronous speech recognition
This resource receives a uri containing the audio resource, download it and transcribes the audio using state-of-the-art deep neural networks. It performs asynchronous speech recognition and the result will be availble using transcription endpoint. This endpoint is designed for transcription of long audio files upto 240 minute.
Using config object you can can specify audio configs such as audioEncoding and sampleRateHertz. We will support different languages so you can choose the languageCode. Using asrModel and languageModel in config you can use customized models. Refer to WebSocket API for speech recognition with streams. Refer to ASR API for fast recognition for short audio files.
Body
Required
post uri and configs to this service for asr.
-
config
object Required Provides information to the recognizer that specifies how to process the request.
-
audio
object Required Contains audio source URI with the encoding specified in the RecognitionConfig.
For asrlongrunning endpoint only uri is accepted.
Property Description uri URI that points to a file that contains audio data bytes as specified in RecognitionConfig. The file must not be compressed (for example, gzip).
Responses
-
OK. Transcription Generated.
-
This response means that server could not understand the request due to invalid syntax.
-
Authentication is needed to get requested response. This is similar to 403, but in this case, authentication is possible.
-
Client does not have access rights to the content so server is rejecting to give proper response.
-
The request method is known by the server but has been disabled and cannot be used.
-
The media format of the requested data is not supported by the server, so the server is rejecting the request.
-
The user has sent too many requests in a given amount of time ("rate limiting").
-
The server has encountered a situation it doesn't know how to handle.
curl \
-X POST https://api.amerandish.com/v1/speech/asrlongrunning \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"config":{"audioEncoding":"LINEAR16","sampleRateHertz":16000,"languageCode":"fa","maxAlternatives":1,"profanityFilter":true,"asrModel":"default","languageModel":"8ac4b75e-d3f8-48f2-80f2-d910fbeb02f4"},"audio":{"uri":"http://files.examplecdn.com/data/example.wav"}}'
{
"config": {
"audioEncoding": "LINEAR16",
"sampleRateHertz": 16000,
"languageCode": "fa",
"maxAlternatives": 1,
"profanityFilter": true,
"asrModel": "default",
"languageModel": "8ac4b75e-d3f8-48f2-80f2-d910fbeb02f4"
},
"audio": {
"uri": "http://files.examplecdn.com/data/example.wav"
}
}
{
"config": {
"audioEncoding": "LINEAR16",
"sampleRateHertz": 16000,
"languageCode": "fa",
"maxAlternatives": 1,
"profanityFilter": true,
"asrModel": "default",
"languageModel": "string"
},
"audio": {
"uri": "string"
}
}
{
"transcriptionId": "string",
"duration": 42.0,
"inferenceTime": 42.0,
"status": "queued",
"results": [
{
"transcript": "string",
"confidence": 42.0,
"words": [
{
"startTime": 42.0,
"endTime": 42.0,
"word": "string",
"confidence": 42.0
}
]
}
]
}
{
"transcriptionId": "string",
"duration": 42.0,
"inferenceTime": 42.0,
"status": "queued",
"results": [
{
"transcript": "string",
"confidence": 42.0,
"words": [
{
"startTime": 42.0,
"endTime": 42.0,
"word": "string",
"confidence": 42.0
}
]
}
]
}
{
"code": 400,
"message": "Bad Request. Invalid JSON object."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 401,
"message": "Unautherized. Invalid Authorization Token."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 403,
"message": "Forbidden. Do not have access right to resource."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 405,
"message": "Method Not Allowed."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 415,
"message": "Unsupported Media Type. Please change requested media type."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 429,
"message": "Too Many Requests. Your request is blocked due to exceeding rate limiting."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}
{
"code": 500,
"message": "Internal Server Error. Please retry later."
}
{
"status": "string",
"detail": "string",
"title": "string",
"type": "string"
}