Microphone Trait
API Service: MicrophoneApi
Trait for devices that support some kind of audio input. The most basic is a simple muting microphone, it's optional to support gain adjustment on a scale.
For the sakes of this trait "gain" means the combination of a gain and a mute state.
| Method | Request Type | Response Type | Description |
|---|---|---|---|
| GetGain | GetMicrophoneGainRequest | smartcore.types.AudioLevel | Get the current state of the gain for the device |
| UpdateGain | UpdateMicrophoneGainRequest | smartcore.types.AudioLevel | update the gain state for the device |
| PullGain | PullMicrophoneGainRequest | PullMicrophoneGainResponse stream |
Info Service: MicrophoneInfo
Describes the capabilities of a specific named device with respect to this trait.
| Method | Request Type | Response Type | Description |
|---|---|---|---|
| DescribeGain | DescribeGainRequest | GainSupport | Get information about how a named device implements Gain features |
GainSupport
GainSupport describes the capabilities of devices implementing this trait.
| Field Name | Type | Description |
|---|---|---|
| resource_support | smartcore.types.ResourceSupport | How a named device supports read/write/pull apis |
| gain_attributes | smartcore.types.FloatAttributes | Attributes associated with the gain property of the microphone. Note that a step value that is the same as the bounds implies that the microphone only supports mute |
| mute_support | smartcore.types.MuteSupport | How is mute implemented by the device. Can help to customise behaviour of interfaces to the device, e.g. by disallowing gain change when muted |
GetMicrophoneGainRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | Name of the device to fetch the state for |
| read_mask | google.protobuf.FieldMask | fields to fetch relative the the AudioLevel type |
UpdateMicrophoneGainRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | Name of the device to update the state for |
| gain | smartcore.types.AudioLevel | The updated gain value |
| delta | bool | Only supported for AudioLevel.gain. Update the value relative to the current value. |
| update_mask | google.protobuf.FieldMask | The fields we intend to update relative to the AudioLevel type |
PullMicrophoneGainRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | Name of the device to fetch the state for |
| read_mask | google.protobuf.FieldMask | fields to fetch relative the the AudioLevel type |
| updates_only | bool | When true the device will only send changes to the resource value. The default behaviour is to send the current value immediately followed by any updates as they happen. |
PullMicrophoneGainResponse
| Field Name | Type | Description |
|---|---|---|
| changes | repeated smartcore.types.AudioLevelChange | Changes since the last message |
DescribeGainRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | The name of the device |