Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
data class AudioChunk(val bytes: ByteArray, val format: AudioFormat, val sequence: Long, val timestampMs: Long = nowMillis(), val endOfStream: Boolean = false)
Link copied to clipboard

Unified audio models for microphone capture and playback across different glasses.

Link copied to clipboard
data class AudioFormat(val encoding: AudioEncoding, val sampleRateHz: Int? = null, val channelCount: Int? = null)
Link copied to clipboard
sealed class AudioSource
Link copied to clipboard
abstract class BaseGlassesClient(initialCapabilities: DeviceCapabilities, eventBufferOverflow: BufferOverflow = BufferOverflow.DROP_OLDEST) : GlassesClient

Shared state, event, and connect lifecycle plumbing for device clients.

Link copied to clipboard
data class CapturedImage(val jpegBytes: ByteArray, val timestampMs: Long = nowMillis(), val width: Int? = null, val height: Int? = null, val rotationDegrees: Int? = null, val sourceModel: GlassesModel)
Link copied to clipboard
data class CaptureOptions(val photoQuality: PhotoQuality = PhotoQuality.HIGH, val targetWidth: Int? = null, val targetHeight: Int? = null, val timeoutMs: Long)
Link copied to clipboard
sealed class ConnectionState

Connection state for a glasses client.

Link copied to clipboard
data class DeviceCapabilities(val canCapturePhoto: Boolean = true, val canDisplayText: Boolean = true, val canDisplayImages: Boolean = false, val canRecordAudio: Boolean = false, val canStreamVideo: Boolean = false, val supportedVideoFormats: List<VideoFrameEncoding> = emptyList(), val canPlayTts: Boolean = false, val canPlayAudioBytes: Boolean = false, val supportsTapEvents: Boolean = false, val supportsLongPressEvents: Boolean = false, val supportsBatteryEvents: Boolean = false, val supportsStreamingTextUpdates: Boolean = false)
Link copied to clipboard
interface DeviceManager

Phone-side manager for glasses whose app runs on the glasses.

Link copied to clipboard
sealed class DeviceManagerState

Installation lifecycle state for a DeviceManager.

Link copied to clipboard
data class DisplayImage(val bytes: ByteArray, val encoding: ImageEncoding)
Link copied to clipboard
data class DisplayImageOptions(val scaleMode: ImageScaleMode = ImageScaleMode.FIT)
Link copied to clipboard
Link copied to clipboard
data class DisplayOptions(val mode: DisplayMode = DisplayMode.REPLACE, val force: Boolean = false)
Link copied to clipboard
Link copied to clipboard
data class ExternalActivityResult(val resultCode: Int, val data: Intent?)

Generic bridge for SDK adapters that need the host app to launch an external activity and return its result asynchronously.

Link copied to clipboard
interface GlassesClient

A minimal, unified API for AI glasses.

Link copied to clipboard
sealed class GlassesError : Exception

Error types returned inside Result by GlassesClient operations.

Link copied to clipboard
sealed class GlassesEvent

Events emitted by a glasses client.

Link copied to clipboard

Device families supported by the unified xg.glass API.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class MicrophoneOptions(val preferredEncoding: AudioEncoding = AudioEncoding.PCM_S16_LE, val preferredSampleRateHz: Int?, val preferredChannelCount: Int? = 1, val audioHint: AudioCaptureHint = AudioCaptureHint.DEFAULT)
Link copied to clipboard

A running microphone capture session.

Link copied to clipboard
data class PcmFormat(val sampleRateHz: Int, val channelCount: Int = 1, val encoding: AudioEncoding = AudioEncoding.PCM_S16_LE)

Format descriptor for headerless PCM data passed via AudioSource.RawBytes.

Link copied to clipboard
Link copied to clipboard
data class PlayAudioOptions(val speechRate: Float? = null, val interrupt: Boolean = true)
Link copied to clipboard
class PushMicrophoneSession(val format: AudioFormat, onStop: () -> Unit = {}, extraBufferCapacity: Int = 128) : MicrophoneSession

A MicrophoneSession whose audio is pushed in by a platform transport — BLE notifications, a Flutter event channel, an OS microphone callback, etc.

Link copied to clipboard
class PushVideoStreamSession(val format: VideoFormat, onStop: () -> Unit = {}, bufferCapacity: Int = 128) : VideoStreamSession

A VideoStreamSession whose frames are pushed by a platform transport.

Link copied to clipboard
data class VideoFormat(val encoding: VideoFrameEncoding, val width: Int? = null, val height: Int? = null, val framesPerSecond: Int? = null)
Link copied to clipboard
data class VideoFrame(val bytes: ByteArray, val format: VideoFormat, val sequence: Long, val timestampMs: Long = nowMillis(), val rotationDegrees: Int? = null, val endOfStream: Boolean = false)
Link copied to clipboard
data class VideoStreamOptions(val preferredEncoding: VideoFrameEncoding = VideoFrameEncoding.JPEG, val preferredWidth: Int? = 640, val preferredHeight: Int? = 480, val frameRateTier: VideoFrameRateTier = VideoFrameRateTier.LOW)
Link copied to clipboard