Using Speech Revolutions with Amazon S3

To transcribe audio stored in S3, you don't need to download it first. Presign a short-lived GET URL for the object, pass that URL to Speech Revolutions, and write the JSON transcript back to a bucket. Everything runs server-side, so your AWS credentials and Speech Revolutions API key stay in your backend.

Use a presigned URL, not a public object

A presigned GET URL gives Speech Revolutions time-limited read access to one object without making the bucket public. Set an expiry longer than the transcription time of your largest file.

Transcribe an object already in S3

Presign a GET URL for the source object and pass it to Speech Revolutions. The SDK detects http(s) URLs, so transcribe() fetches the audio directly from S3. Then serialize result.to_dict() (or result.toDict()) and write it to your output bucket with PutObject.

import json

import boto3
from speechrevolutions import SpeechRevolutions

s3 = boto3.client("s3")
client = SpeechRevolutions()  # SPEECHREVOLUTIONS_API_KEY

SRC_BUCKET = "my-audio"
OUT_BUCKET = "my-transcripts"


def transcribe_s3_object(key: str) -> str:
    # 1. Presign a short-lived GET so Speech Revolutions can read the object.
    audio_url = s3.generate_presigned_url(
        "get_object",
        Params={"Bucket": SRC_BUCKET, "Key": key},
        ExpiresIn=3600,  # seconds — outlast the transcription
    )

    # 2. Pass the URL straight to Speech Revolutions (auto-detected as a URL).
    result = client.transcribe(audio_url, speaker_labels=True)

    # 3. Store the JSON result back to S3.
    out_key = key.rsplit(".", 1)[0] + ".json"
    s3.put_object(
        Bucket=OUT_BUCKET,
        Key=out_key,
        Body=json.dumps(result.to_dict()).encode(),
        ContentType="application/json",
    )
    return out_key

Long files: submit() and a webhook

For large recordings, don't block on transcribe(). Presign the GET URL, call submit() with a callback_url, and write the result to S3 from your webhook handler when the job completes.

audio_url = s3.generate_presigned_url(
    "get_object",
    Params={"Bucket": SRC_BUCKET, "Key": key},
    ExpiresIn=3600,
)

job_id = client.submit(
    audio_url,
    speaker_labels=True,
    callback_url="https://you.example.com/webhooks/stt",
)
# In the webhook handler (after verifying X-SR-Signature):
#   result = client.get_transcript(event["job_id"])
#   s3.put_object(Bucket=OUT_BUCKET, Key=out_key,
#                 Body=json.dumps(result.to_dict()).encode())
Verify the webhook signature

The completion POST is signed with HMAC-SHA256 in the X-SR-Signature: sha256=<hex> header. Always verify it against the raw request bytes before you use download_url, using your organization's signing secret from the console (API Keys → Webhook signing secret). The webhooks guide shows how in every language.

When you pass a URL, Speech Revolutions fetches the audio directly. The SDK then waits on the SSE job stream and parses the result. See the Python and JavaScript SDK pages for all options and result fields.