Skip to content

Microphone Components

The microphone domain contains common functionality shared across the microphone platforms.

Configuration variables:

  • on_data (Optional, Automation): An automation to perform when new data is received.

A microphone source configuration is used by components to ensure that it receives audio in the required format.

Configuration variables:

  • microphone (Required, ID): The microphone to use for input.

  • bits_per_sample (Optional, int): The bits per sample to use as input to the component. May be restricted by the component to a specific value.

  • channels (Optional, list): A list of 0-indexed channel numbers enabling them to use as input to the component. The total amount may be restricted by the component. Defaults to 0, the first channel read by the microphone.

  • gain_factor (Optional, int): The gain factor to apply to audio read from the microphone. Ranges from 1 to 64. Defaults to 1, no gain.

All microphone actions can be used without specifying an id if you have only one microphone in your configuration YAML.

Configuration variables:

id (Optional, ID): The microphone to control. Defaults to the only one in YAML.

This action will start capturing audio data from the microphone. The data will be passed to any components listening and will be available in the on_data trigger.

This action will stop capturing audio data from the microphone.

This action will apply a software mute to the audio data from the microphone before passing it to any listening components.

This action will disable applying a software mute initiated with microphone.mute.

This trigger will fire when new data is received from the microphone. The data is available as a std::vector<uint8_t> in the variable x. This data is the raw microphone audio and includes all the read bits per sample and channels.

microphone:
- platform: ...
on_data:
- logger.log:
format: "Received %d bytes"
args: ['x.size()']

Configuration variables:

  • id (Optional, ID): The microphone to check. Defaults to the only one in YAML.

All microphone conditions can be used without specifying an id if you have only one microphone in your configuration YAML.

Configuration variables:

id (Optional, ID): The microphone to check. Defaults to the only one in YAML.

This condition will check if the microphone is currently capturing audio data.

This condition will check if the microphone is currently apply a software mute.