stt-speed-test / README.md
Saidwire's picture
Speed test: big number is processing time, full breakdown below (owner-approved 11-01)
6982366 verified
|
Raw History Blame Contribute Delete
3 kB
---
title: How fast is your speech-to-text?
emoji: ⚡
colorFrom: indigo
colorTo: gray
sdk: static
app_file: index.html
pinned: false
license: mit
short_description: Time end-of-speech to final transcript, live
tags:
- speech-to-text
- asr
- real-time
- streaming
- latency
- transcription
- voice-agents
---
# How fast is your speech-to-text?
Click **Talk** and say a sentence or two. The page streams your microphone to the
[Saidwire](https://saidwire.com) real-time speech-to-text API at normal speed, like a live call,
shows the words as they arrive, and times the last step: from the end of your speech to the final
transcript, split into processing time and network time.
**35 ms median after Finalize, measured in US East; your network adds to what you see.**
**How it's measured.** The page listens for a short pause (0.35 s) to decide you have finished, then
sends a `Finalize` message (the "user stopped talking" signal a voice agent sends). Our demo server
starts a clock when it passes `Finalize` to the speech service and stops it when the final transcript
comes back. It also measures the network trip between itself and our speech servers on every try and
subtracts it: what is left is the big number, the processing time in our speech service. Under it the
page shows the full sum: processing + the trip between our servers + your own internet round trip
(timed in your browser) = what you felt.
For comparison, other speech-to-text providers publish final-transcript times of about 300-350 ms.
## Use it in your own app
- Get 120 free hours: **[saidwire.com/dev](https://saidwire.com/dev)** (no card)
- Docs: [saidwire.com/docs/api](https://saidwire.com/docs/api)
- English. $0.30 per audio hour.
```python
# pip install websockets
import asyncio, json, os
from websockets.asyncio.client import connect
URL = "wss://api.saidwire.com/v1/listen?encoding=linear16&sample_rate=16000&interim_results=true&punctuate=true"
async def main(pcm: bytes): # 16 kHz mono 16-bit PCM
async with connect(URL, additional_headers={"Authorization": f"Token {os.environ['SAIDWIRE_API_KEY']}"}) as ws:
for i in range(0, len(pcm), 640): # 20 ms frames, real time
await ws.send(pcm[i:i + 640]); await asyncio.sleep(0.02)
await ws.send(json.dumps({"type": "Finalize"})) # user stopped talking
async for raw in ws:
m = json.loads(raw)
if m.get("type") == "Results" and m.get("from_finalize"):
print(m["channel"]["alternatives"][0]["transcript"]); break
```
## About this Space
This is a static page: no server code and no model run in the Space. The page talks to a small
Saidwire demo proxy at `saidwire.com`, which holds the API key, so no key is ever in your browser.
Your audio is streamed to the speech service and is not stored; only the time, length and speed
numbers of each try are kept, not what you said.
Limits: 30 seconds per try and 5 tries per hour per visitor, English only.