session.mic to receive raw audio chunks from the glasses microphone and detect when the user is speaking. This is separate from transcription - subscribing to session.mic gives you raw audio data, not text.
Audio Chunks
Receive raw PCM audio data from the microphone:Voice Activity Detection
Detect when the user starts or stops speaking:Stop the Microphone
Callsession.mic.stop() to turn off the microphone and stop all audio chunk and voice activity callbacks:
onChunk or onVoiceActivity again will restart the microphone.
Check Permission
Usesession.mic.hasPermission to check whether your app has microphone access before subscribing:
When to Use Mic vs Transcription
| Use case | Use this |
|---|---|
| Show what the user said as text | session.transcription |
| Run your own speech recognition model | session.mic |
| Detect when the user is speaking (VAD) | session.mic |
| Record audio for later processing | session.mic |
| Build a voice command system | session.transcription |
| Stream audio to an external API (Whisper, Deepgram, etc.) | session.mic |
| Stop the mic to save battery | session.mic.stop() |
session.transcription does NOT give you raw audio. Subscribing to session.mic does NOT give you transcription text. They are independent. Either one activates the hardware microphone. If you want both, subscribe to both.
Common Patterns
Send audio to an external API
Buffer audio while speaking
Permissions
Your app needs the microphone permission to receive audio chunks. Add it in the Developer Console when creating or editing your app.Migrating from v2
session.mic.onVoiceActivity, session.mic.isSpeaking), session.mic.stop(), and session.mic.hasPermission are new in v3 and have no v2 equivalent. See the Migration Guide for the full list of changes.
