Skip to content

Microphone

Overview

Maverick AI glasses include an on-board microphone. The SDK handles microphone functionality via the M2MicService (accessed from Evs.micService).

Audio frames are captured on the glasses, encoded as Ogg/Opus, and streamed to the SDK over BLE.

Configuration

The microphone is opened with a bitrate parameter (in KB/s):

Parameter Range Default Description
Bitrate 10–40 KB/s - Ogg/Opus encoding bitrate

Higher bitrate produces better audio quality but uses more BLE bandwidth.

Audio Format

Property Value
Codec Ogg/Opus
Sample rate (glasses) 8 kHz
Channels Mono
Frame delivery onMicrophoneOggOpusFrameReceived / onMicrophoneRawReceived callbacks

The SDK delivers both Ogg/Opus-wrapped and raw Opus frames to the application.

Usage

Opening the microphone

Evs.micService.registerListener(object : IM2MicrophoneEvents {
    override fun onMicrophoneStateChanged(isOn: Boolean) {
        // microphone started or stopped
    }

    override fun onMicrophoneOggOpusFrameReceived(data: ByteArray, offset: Int, size: Int) {
        // Ogg/Opus encoded audio frame
        // Forward to speech-to-text engine or decode with Opus library
    }

    override fun onMicrophoneRawReceived(rawData: ByteArray) {
        // Raw Opus frame (without Ogg container)
    }

    override fun onError(type: M2MicServiceErrors, message: String) {
        // handle error
    }
})

Evs.micService.openMicrophone(bitrateKBs = 20)
Evs.shared.micService.registerListener(listener: micEventsHandler)
Evs.shared.micService.openMicrophone(bitrateKBs: 20)

Closing the microphone

Evs.micService.closeMicrophone()

PCM Decoding (Optional)

The SDK includes a built-in Opus-to-PCM decoder. When enabled, audio frames are decoded to raw PCM alongside the Opus stream:

Evs.micService.enablePCM(true)
Evs.micService.pcmFrameListener { pcmData, sampleRate ->
    // pcmData: decoded PCM audio bytes
    // sampleRate: output sample rate in Hz
}

Call enablePCM(false) to disable decoding when no longer needed.

Notes

  • The microphone operates on glasses hardware; opening it starts the audio pipeline.
  • Close the microphone when not in use to save battery.
  • Ogg/Opus frames can be directly forwarded to speech-to-text APIs (e.g. Google Speech, Whisper) without decoding.

Codec may change

The current Ogg/Opus codec is subject to change in future SDK versions. Plan for codec abstraction if building long-term audio pipelines.

Second microphone support

A second microphone input will be added in a future SDK version.


See Also

  • AI Vision - Glasses AI vision capture and streaming
  • Display - Brightness and display control