Skip to content

MenaVoice Speech to Text turns recordings into text. It's tuned for Arabic, transcribing Arabic speech in Arabic script, and also handles English, French and other languages.

Transcribe a file

Upload the audio as multipart form data, in a field named audio:

import os

import requests

with open("meeting.m4a", "rb") as f:
    response = requests.post(
        "https://api.menavoice.ai/api/stt/transcribe",
        headers={"x-api-key": os.environ["MENAVOICE_API_KEY"]},
        files={"audio": ("meeting.m4a", f, "audio/mp4")},
        data={"language": "ar"},
        timeout=300,
    )
response.raise_for_status()
print(response.json()["text"])

The response contains the transcript:

{
  "text": "أهلاً بالجميع، خلونا نبدأ الاجتماع بمراجعة أرقام الشهر الماضي.",
  "minutes": 1.4,
  "mimeType": "audio/mp4"
}
  • text is the transcript. It's an empty string if no speech was found.
  • minutes is the billable length of the audio, rounded to a tenth of a minute (at least 0.1). The web app uses it to count plan minutes.
  • mimeType is the audio format MenaVoice read the file as.

Send audio as JSON

If uploading a file is awkward, send the audio base64-encoded in a JSON body instead:

{
  "audio": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYwLjE2LjEwMAAAAAAAAAAA...",
  "mimeType": "audio/mpeg",
  "language": "ar"
}

JSON bodies are limited to 10 MB. Base64 makes audio about a third larger, so this works for files up to roughly 7 MB. Use multipart for anything bigger.

Formats and size

FormatsMP3, WAV, WebM, OGG, M4A and FLAC
Largest file25 MB (multipart upload)
Largest JSON body10 MB, including the base64 audio

Files in other formats are rejected with 400 Unsupported audio format. Larger files return 413.

Language

language is an optional hint in BCP-47 form, such as ar, en or fr. Leave it out and MenaVoice detects the language itself. A hint helps most with short clips and with recordings that mix languages.

Pricing

  • API: $25 per million characters of transcript. You pay for the text you get back, not for the length of the audio. A request needs a positive API balance to start.
  • Web app: transcriptions use your plan's monthly speech-to-text minutes, counted by the minutes value above.

See Pricing & Rate Limits.

Getting the best accuracy

  • Record close to the speaker, in a quiet room, and avoid music underneath speech.
  • Prefer one speaker at a time. Crosstalk is harder to transcribe than turns.
  • Use a good bitrate. Heavily compressed audio loses the detail that separates similar sounds.
  • Set language for short clips, where there's little speech to detect the language from.

In the web app

The Speech to Text page transcribes uploaded files up to 25 MB, or recordings made right in the browser, up to 10 minutes long. Choose Auto, Arabic, English or French, then copy or download the transcript.

Was this page helpful?