Represents a device that takes audio input.
Return the audio input properties.
const audioIn = new VIAM.AudioInClient(machine, 'my_audio_in');const properties = await audioIn.getProperties(); Copy
const audioIn = new VIAM.AudioInClient(machine, 'my_audio_in');const properties = await audioIn.getProperties();
Readonly
The name of the resource.
Send/Receive arbitrary commands to the resource.
The command to execute. Accepts either a Struct or a plain object, which will be converted automatically.
// Plain object (recommended)const result = await resource.doCommand({ myCommand: { key: 'value' },});// Struct (still supported)import { Struct } from '@viamrobotics/sdk';const result = await resource.doCommand( Struct.fromJson({ myCommand: { key: 'value' } })); Copy
// Plain object (recommended)const result = await resource.doCommand({ myCommand: { key: 'value' },});// Struct (still supported)import { Struct } from '@viamrobotics/sdk';const result = await resource.doCommand( Struct.fromJson({ myCommand: { key: 'value' } }));
Stream audio from the device.
Optional
const audioIn = new VIAM.AudioInClient(machine, 'my_audio_in');const stream = audioIn.getAudio(VIAM.AudioCodec.PCM16, 3, 0n, {}); Copy
const audioIn = new VIAM.AudioInClient(machine, 'my_audio_in');const stream = audioIn.getAudio(VIAM.AudioCodec.PCM16, 3, 0n, {});
Represents a device that takes audio input.