Guide
Live or recorded pronunciation assessment
The API has two parts with two different jobs. One assesses a recording and returns the verdict. The other follows a recording while it is made, says when the learner has finished each sentence, so your application can stop listening on its own, and returns the same verdict for each sentence as it is read.
Two jobs
A verdict, or knowing when to stop
- Assessment
POST /v1/assess-pronunciationtakes a recording and the sentence it was meant to be, and returns the score, the status of every word and sound, and the letters behind each mistake. One request, one response, once the learner has finished.- Live session
POST /v1/live-sessionsopens a WebSocket that listens while the learner reads aloud, and says when each expected sentence has been read, then sends that sentence's assessment, the same as an assessment request returns. Your application knows when to stop recording, or to move to the next sentence, without the learner pressing a button.
So the question is not which one is better. It is whether the learner should have to say they are done.
Assessment alone
When a single assessment is enough
- The learner presses a button to start and to stop, as in most practice apps today.
- The recording already exists: one saved earlier, or homework sent in from another device.
- Your server assesses recordings in the background, with nobody waiting on a microphone.
One request per recording, from your server: a WAV of 16-bit PCM, up to 40 seconds, with the expected sentence. Nothing to keep open, nothing to stream.
Adding a live session
When the learner should not have to press stop
- Young children
- A child reading aloud forgets the stop button, or presses it mid-word. The session says when the sentence has been read, so your application stops recording then, and it waits a moment of silence for a child still working out the last word.
- Reading several sentences
- Send them all at the start. Each is reported as it is read, in order, so the page can turn to the next one while the learner keeps going.
- Hands-free and voice-first apps
- Wherever a tap is awkward: on a phone held at a distance, or in an app driven by voice.
A live session
Following the reading, sentence by sentence
Ask for a session
Your server calls
POST /v1/live-sessionswith its API key and hands the browser only the URL it gets back: valid for one connection, within 120 seconds. The key never reaches the browser.Listen
The browser opens the WebSocket, sends the sentences, and streams the microphone as 16 kHz mono PCM, keeping its own copy of the recording in case the session ends early.
Move on with the reader
When a sentence is reported read, show the next one, or stop recording after the last.
Show the scores
Each sentence's assessment follows its report: the score, word by word and sound by sound, as
POST /v1/assess-pronunciationreturns it. There is nothing more to send.
The messages a reading session exchanges, in order:
→ {"type":"start","sentences":["Le chat dort.","Il fait beau."]}
→ binary frames: 16-bit PCM, 100 ms each
← {"type":"ready",…}
← {"type":"sentence-read","sentenceIndex":0,"endsAtMs":1840,"words":[…]}
← {"type":"sentence-assessed","sentenceIndex":0,…,"assessment":{"scorePercent":92.5,…}}
← {"type":"sentence-read","sentenceIndex":1,"endsAtMs":3920,"words":[…]}
→ {"type":"stop"}
← {"type":"sentence-assessed","sentenceIndex":1,…,"assessment":{"scorePercent":87.0,…}}
Side by side
The two compared
| Assessment | Live session | |
|---|---|---|
| Returns | The verdict: scores, statuses, faults, letters | A sentence read, then the same verdict for it |
| Called from | Your server, with the API key | The browser, with a one-time URL your server asked for |
| Transport | One HTTP request | A WebSocket, for as long as the learner speaks |
| Audio | A WAV of 16-bit PCM | A stream of 16 kHz mono PCM, silences included |
| Length | Up to 40 seconds per request | Up to the session's maximum duration, in the API reference, and 40 seconds per sentence |
| Text | Up to 200 words | Up to 20 sentences and 200 words |
Billing
Billed by the second of audio assessed
An assessment is billed by the second of audio, on your AWS invoice. In a live session, each sentence's assessment is billed the same way, for that sentence's audio; following the reading, and usually the pauses between sentences, are not. The choice is about the learner, not the price.
An assessment that is refused or fails is not billed either.
When it goes wrong
Always keep the stop button
A live session may end before the learner has finished: a network that
drops, a session that stops receiving audio, or every session your
subscription may run at once already in use. Whatever the reason, fall
back to the button: let the learner stop by hand, and send what was
not yet assessed to POST /v1/assess-pronunciation. A sentence the session
already assessed needs no second request.
A session that ends because all of yours are in use can be retried a little later, with a new URL from your server. The number your subscription may run at once can be raised by writing to us. Every field, message and close code is in the API reference.
Next
Hear it for yourself
Read a sentence aloud and see, word by word and sound by sound, what the API heard. No account needed, and nothing you record is kept.
Learn more