This article shows how to use synchronous /asr/transcribe method to transcribe audio file, that is available at a specified URL, into a transcribed utterance (or several utterance alternatives).
Note that the longer the audio, the less likely it is that multiple alternatives will be generated.
Maximum length of audio allowed for this synchronous web api is 60 seconds.
All examples assume bash shell - on Windows you can use GitBash or you can install Linux.
Input JSON
The simplest input JSON using default settings is provided below (also attached as trans-sync-pre.json).
{ "audio" : { "source" : { "fromUrl" : { "url" : "https://s3.us-east-2.amazonaws.com/files.public.voicegain.ai/3sec.wav" } } }, "settings" : { } }
Invocation using curl
The web API can be invoked using a curl POST command like the one shown below. The JWT token following the "Bearer" needs to be replaced with the JWT obtained from the Voicegain Web Console (see JWT Authentication). If running on Windows, lines need to be terminated with ^ instead of \
curl -i \
-H "Content-Type: application/json" \
-H 'Accept: application/json' \
-H "Authorization: Bearer eyJhbGciOiJIUzxxNiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJodHRxczovL2FwaS5hc2NhbGxvbi5pby9hcGkvdj...Tg0MjYtY2M5M2Y3YzJhMjJmIn0.RaXAyjoj7Bgz_1batCa5LYmTxqkFtvRKv6_BOGCO70w" \
-d @trans-sync-pre.json \
--verbose \
https://api.voicegain.ai/v1/asr/transcribe
Comments
0 comments
Article is closed for comments.