session.mic is the low-level audio input: raw frames and a voice-activity
signal. If you want text, use session.transcription
instead. Reach for mic when you need the audio itself, like recording a clip or
running your own audio processing.
Both subscriptions need the MICROPHONE permission in your
manifest, or the phone rejects them
with PERMISSION_NOT_DECLARED.
Raw audio
AudioChunkData has:
Voice activity
onVoiceActivity fires when the user starts and stops speaking, without giving
you the audio:
Cleaning up
Both methods return an unsubscribe function, andstop() tears down everything
this module owns:
session.mic.hasPermission reports whether MICROPHONE is declared in your
manifest, not whether the user granted the OS prompt. If they denied it, the
subscription succeeds but no chunks arrive.
mic, transcription, and translation are independent. Subscribing to raw
audio does not give you transcripts, and vice versa. Audio output (playback and
text-to-speech) lives on session.speaker.
