Audio transcription and translation
Audio transcription is used to convert audio into text; audio translation is used to translate audio content into the target language. Both types of API are used to upload audio files on multipart forms.
API Path
| Methodology | Path | Purpose |
|---|---|---|
POST | /v1/audio/transcriptions | Audio transcription. |
POST | /v1/audio/translations | Audio translation. |
Audio transcription
http
POST /v1/audio/transcriptionsbash
curl https://moonnexai.com/v1/audio/transcriptions \
-H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
-F "file=@./speech.mp3" \
-F "model=whisper-1"Audio translation
http
POST /v1/audio/translationsbash
curl https://moonnexai.com/v1/audio/translations \
-H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
-F "file=@./speech.mp3" \
-F "model=whisper-1"Common field
| field | Annotations |
|---|---|
file | Audio file. |
model | transcription or translation model name. |
language | Enter a language hint, which is based on API Reference. |
response_format | Returns formats such as json or text. |
response Processing
| scene | Treatment |
|---|---|
| Normal Text | Saves transcription text, filename and model name. |
| Subtitles scene | Saves the text of the subparagraphs and the time information, which is the return format. |
| Long Audio | Slice-processing merges text by business ID. |
Access Recommendations
- Confirm that the audio is clear before upload and minimize background noise.
- Long audio suggests first slice and then merge the results by business ID.
- Saves the text of the segment, time information and original file name when subtitles are required.