Quickstart
Get an API key, install an SDK (or use cURL), and transcribe a file.
1. Get an API key
Create a key in the developer console. Export it in your shell:
export SPEECHREVOLUTIONS_API_KEY=stt_...2a. Use an SDK (recommended)
The SDK uploads the file for you (in parts, for large files), then waits for the transcript.
pip install speechrevolutionsTranscribe a file. The code below uses a 47-second hosted sample, a two-voice passage from Maupassant's The Diamond Necklace. Replace it with a local path or your own URL.
Sample: a public-domain LibriVox dramatic reading.
from speechrevolutions import SpeechRevolutions
client = SpeechRevolutions() # reads SPEECHREVOLUTIONS_API_KEY
result = client.transcribe("https://docs.speechrevolutions.com/samples/diamond-necklace.mp3", speaker_labels=True)
print(result.text)
for u in result.utterances:
print(f"{u.speaker}: {u.text}")Output:
Why, my dear? I thought you would be glad you never go out and this is such a fine opportunity. I had great trouble to get it. Every one wants to go. It is very select and they are not giving many invitations to clerks. The whole official world will be there. She looked at him with an irritated glance and said impatiently, And what do you wish me to put on my back? He had not thought of that, he stammered. Why the gown you go to the theater in? It looks very well to me. He stopped distracted, seeing that his wife was weeping, Two great tears ran slowly from the corners of her eyes toward the corners of her mouth.
SPEAKER_1: Why, my dear? I thought you would be glad you never go out and this is such a fine opportunity. I had great trouble to get it. Every one wants to go. It is very select and they are not giving many invitations to clerks. The whole official world will be there.
SPEAKER_2: She looked at him with an irritated glance and said impatiently, And what do you wish me to put on my back? He had not thought of that, he stammered.
SPEAKER_1: Why the gown you go to the theater in? It looks very well to me.
SPEAKER_2: He stopped distracted, seeing that his wife was weeping, Two great tears ran slowly from the corners of her eyes toward the corners of her mouth.2b. Use cURL from a terminal
For scripts and one-off jobs, stream the file to POST /api/v1/transcribe. The connection stays open and emits progress events until the transcript is ready.
curl -sO https://docs.speechrevolutions.com/samples/diamond-necklace.mp3
curl -N -X POST \
"https://api.speechrevolutions.com/api/v1/transcribe?output_type=json&word_timestamps=true&speaker_labels=true&nltk=true" \
-H "X-API-Key: $SPEECHREVOLUTIONS_API_KEY" \
--data-binary @diamond-necklace.mp3Prefer the SDK in application code. Prefer /transcribe when you want a single streaming HTTP call from a shell.
3. Watch live progress (optional)
The SDKs report real-time upload and transcription progress, as console bars (progress=True) or as callbacks with a percent field.
Files under about 3 MiB are processed in a single pass and may report no transcription progress before they complete. For these files the bar jumps from the end of the upload to done.
result = client.transcribe("audio.mp3", progress=True)
# or a callback
result = client.transcribe(
"audio.mp3",
on_progress=lambda e: print(e.percent, e.step),
)See each SDK page for the full onProgress / onUploadProgress API.