Our ASR API accepts the following three inputs in the request:
-
file - the audio or video file to be transcribed
-
language - the language of the source audio/video in all lowercase (eg: tamil, english)
-
vtt (optional) - whether a webVTT caption file has to be generated. This is an optional value. It accepts two string values either true or false. By default, this is false. This can be used for captioning purposes.
On success, the API returns a JSON response with the following fields:
-
status: success
-
time_taken: time taken to transcribe the given audio/video in seconds
-
transcript: the transcription of the given input
-
vtt: WebVTT caption if it was requested
On failure, the API returns a JSON response with the following fields:
-
status: failure
-
reason: The reason for failure of the request
Sample audio files to test API: English, Tamil
Our ASR API accepts files of most common formats such as mp3, mp4, wav, ogg etc.,
Currently supported languages:
-
English
-
Tamil
-
Hindi
-
Gujarati
-
Kannada
-
Marathi
-
Telugu
Request: curl -v -X POST -F 'file=@voice.mp3' -F 'language=english' -F 'vtt=true' https://asr.iitm.ac.in/asr/v2/decode
Response: {"status":"success","time_taken":"4.61","transcript":"welcome to madras program thank you","vtt":"WEBVTT\n\n00:00:00.800 --> 00:00:04.600\nwelcome to madras\n\n00:00:04.900 --> 00:00:10.000\nprogram thank you"}
import requests
files = {
'file': open('tamil.mp3', 'rb'),
'language': (None, 'tamil'),
'vtt': (None, 'true'),
}
response = requests.post('https://asr.iitm.ac.in/asr/v2/decode', files=files)
print(response.json())