Microphone Components

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

Base Microphone Configuration

Configuration variables:

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

Microphone Actions

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.

microphone.capture Action

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.

microphone.stop_capture Action

This action will stop capturing audio data from the microphone.

Microphone Triggers

microphone.on_data Trigger

This trigger will fire when new data is received from the microphone. The data is available as a std::vector<int16_t> in the variable x.

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.

Microphone Conditions

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.

microphone.is_capturing Condition

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

Platforms

See Also