session.transcription. Get real-time speech-to-text from the glasses microphone, with support for multiple languages and speaker diarization.
Basic Usage
.on() returns a cleanup function. Call it when you want to stop receiving transcriptions:
How It Works
- User speaks into the glasses microphone
- Audio streams to MentraOS Cloud
- Cloud runs speech recognition (via Soniox)
- Transcription events are sent to your app
- You receive interim results (while speaking) and final results (when a sentence completes)
Transcription Data
Each event gives you aTranscriptionData object:
Interim vs Final Results
While the user is speaking, you receive interim results that update in real time. When the user finishes a sentence, you get a final result.Language-Specific Subscriptions
Subscribe to transcriptions in a specific language:Configuration
Configure transcription behavior before or after subscribing:Language Hints
Language hints tell the speech recognizer which languages to expect. This improves accuracy, especially in multilingual environments.Speaker Diarization
When diarization is enabled, each transcription event includes aspeakerId that identifies which person is speaking. This is useful for meeting transcription, group conversations, and any scenario with multiple speakers.
Stopping Transcription
Call the cleanup function returned by.on() or .forLanguage():
Permissions
Your app needs the microphone permission to receive transcriptions. Add it in the Developer Console when creating or editing your app. Without microphone permission,session.transcription.on() will not receive any data.
Complete Example
A simple live captions app:Migrating from v2
TranscriptionData object shape is the same. Only the access pattern changed. See the Migration Guide for the full list of changes.
