Skip to main content
Version: QTrobot V3

Microphone

robot.microphone reads the robot's internal microphone array and tunes its DSP. These examples assume you already have a connected robot — see Connection if you haven't set one up yet.

Setup

<script src="https://cdn.jsdelivr.net/npm/@luxai-qtrobot/robot-sdk/dist/qtrobot-sdk.umd.js"></script>
npm install @luxai-qtrobot/robot-sdk

DSP tuning

These are plain RPC calls, so they work the same over MQTT or WebRTC.

const params = await robot.microphone.getIntTuning()
console.log('Internal mic tuning parameters:', params)
const ok = await robot.microphone.setIntTuning({ name: 'AGCONOFF', value: 1.0 })
console.log(`setIntTuning result: ${ok}`)

const params = await robot.microphone.getIntTuning()
console.log(`AGCONOFF after set: ${params['AGCONOFF']}`)

Listen to the robot's microphone live (WebRTC)

For live audio from the robot's mic, use WebRTC and the native media track — the same mechanism used to receive the robot's camera feed in Camera:

const robot = await Robot.connectWebrtcMqtt(broker, robotId)

const track = await robot.extra.receiveAudioTrack('/mic/int/audio/ch0/stream:o')
const audioEl = document.getElementById('audio-el') as HTMLAudioElement
audioEl.srcObject = new MediaStream([track])

That's the full pattern from web/webrtc/microphone.html — channel ch0 is the internal array's processed/beamformed channel. See the full example on GitHub for the connect/mute UI around it.

Next steps

Continue with the Camera tutorial, or see the full robot.microphone namespace in the TypeScript/Node.js API Reference.