In a world that’s more connected than ever, effective cross-border communication is paramount. Whether you’re a technical guru seeking a seamless solution or a business visionary looking to break down language barriers, our revolutionary Audio-to-Text Translation API is here to transform how you interact with the world.
The API simplifies the complex process of converting audio in any language into crystal-clear English text. The API Service can be utilized in various real-world use cases to facilitate language translation. Here are some scenarios where the API can be beneficial:
These are just a few examples of how the Audio Translation API Plugin can be applied in real-world scenarios to enhance communication, accessibility, and user experience for various industries and applications.
OpenAI API key
, OpenAI audio model
, and an Audio folder name
. Enter the required details and click the Save button:There is only one method in this service – requestTranslation
. This method translates an audio file in any language to English.
Method:
POST
Endpoint URL:
https://xxxx.backendless.app/api/services/OpenAIAudioTranslation/translate
The xxxx.backendless.app
is a subdomain assigned to your application. For more information, see the Client-side Setup section of the Backendless documentation.
Request Headers:
Content-Type:application/json
Request Body:
The request body must be a JSON object with the structure shown below:
{ "audioFileUrl": "string", "model": "string", "prompt": "string", "responseFormat": "string", "temperature": 0, "saveSource": false }
Parameters explanation:
audioFileUrl
– Required. A URL to an audio file in one of the following formats: flac
, mp3
, mp4
, mpeg
, mpga
, m4a
, ogg
, wav
, or webm
.model
– Optional. OpenAI model, for a list of models, refer to https://platform.openai.com/docs/models/overview. Only audio models can be used in this service, whisper-1
is set as default.prompt
– Optional. A text to guide the model’s style or continue a previous audio segment. The prompt should be in English.responseFormat
– Optional. The format of the transcript output, in one of these options: JSON
, text
, srt
, verbose_json
, or vtt
. JSON
by default.temperature
– Optional. The sampling temperature is between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.saveSource
– Optional. Default value is false
. Set this to true
, if you want to save the file referenced in the audioFileUrl
parameter in the Backendless file storage of your app. The file will be saved in the folder you specified during the service installation.Response Body:
Returns translation in specified “responseFormat
” value, JSON by default.
Example:
curl -X "POST" "https://xxx.backendless.app/api/services/OpenAIAudioTranslation/translate" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d $'{ "audioFileUrl": "https://xxx.backendless.app/api/files/audio/export_ofoct.mp3", "responseFormat": "json", "temperature": 0.5, "saveSource": true }'
Response:
{ "text": "OpenAI's Translation API can be utilized in various real-world use cases to facilitate language translation." }