API References
Speech-to-Text (File) API
The Speech-to-Text API powered by Reverie’s AI technology accurately converts speech into text. The solution can transcribe audio files of various Indian languages and audio formats.
How Does API Work?
The process to transcribe an audio file:
- Post the request by:
- Enter the valid
REV-APPNAME
,REV-APP-ID
, andREV-API-KEY
. - Define the Language Code and domain.
- Upload the audio file to transcribe.
- Enter the valid
- The API will return the text in the requested Indian language.
cURL for Integration
Transcribing Audio
Request
Response
Transcribing Audio other than Default Format
Request
Response
Error Response
API References
HTTP Request URL
URL Elements | Sample URL |
---|---|
https://(hostname) | https://revapi.reverieinc.com/ |
Headers
The format of the data to be posted: application/json
A unique key/token is provided by Reverie to identify the user using the STT API
The unique account ID to identify the user and the default account settings
The parameter to identify the API : stt_file
- Indicates the language in which the audio is spoken
- Example :
or
,hi
,bn
- Refer to section Language Codes for valid language code.
- Refer to the universe in which the STT API is used for transcribing the audio file
- Example: Banking, Insurance, etc.
- Refer to section Domain Codes for valid language code.
- Indicates the supporting format of the audio file
- Refer to section Audio Format Codes for valid language code.
- Indicates the type of logging of data you can choose
- Indicates whether capitalisation and Punctuation is needed in the transcript
- It will enable punctuation and capitalisation in the transcript. The values it can take are
true
andfalse
.
Request
- Local audio file’s path to obtain the transcript.
audio_file
length should be equal to or less than 300 seconds (5 minutes).
- The audio file’s public URL to obtain the transcript.
file_url
length should be equal to or less than 300 seconds (5 minutes).
Response
- API will auto-assign a unique identification number for each request.
- Will indicate the functional status of the API:
- If the success =
true
, then the API is functioning and ready to generate output. - If the success =
false
, then the API is not functional and has some errors.
- If the success =
- Reason for obtaining the final output.
- If the final =
true
, then the received text is the final output. - If the final =
false
, then the text received is partial and is still processing the file.
- If the final =
- The cause will appear for both successful and failed requests.
- The audio file transcribed into text format in the requested language.
- The level of confidence that Reverie STT API has in the accuracy of the transcription.
- The Confidence score ranges from
0
to1
. Higher scores indicate greater relevance to the transcription.
- The beautified text of the final transcript.
- If the final transcript consists of digits, URL, app names, it is quickly converted to a readable format for the user.
Handling Errors
The STT API raises exceptions for many reasons, such as a failed connection, invalid parameters, authentication errors, and network unavailability. We provide more specific human-readable messages with an error response so that users can react to errors more.
API Response Codes
Code | Message | Description |
---|---|---|
403 | Invalid REV-API-KEY or REV-APP-ID | Entered invalid credentials. |
403 | usage exhausted | The provided credit limit is exhausted. |
403 | API key expired | The API key provided to a user has expired. |
403 | unauthorized to use this API | The user is not authorized to use the STT API. |
403 | unauthorized to use this src/tgt language | The invalid language code is passed, or the user is not authorized to use it. |
400 | no domain given | The domain name is missing. |
415 | File not supported | Upload only audio formats like .wav, .mp3. |
400 | invalid sample_rate value | The requested audio sample rate is invalid or not supported by the API. |
400 | no file or file url given | The input is missing. |
400 | Too many samples | The length of the uploaded audio file is greater than 300 seconds. |
504 | upstream request timeout | Terminated the request as it took longer than the defined time. |
200 | EOF received | The input is received completely, and the end of the file is received. |
200 | silence detected | Final response as silence was detected in the audio. |