diff --git a/docs/docs/configuration/audio_detectors.md b/docs/docs/configuration/audio_detectors.md index b541c86707..39ec2e9ff9 100644 --- a/docs/docs/configuration/audio_detectors.md +++ b/docs/docs/configuration/audio_detectors.md @@ -256,7 +256,7 @@ The only field that is valid at the camera level is `enabled`. #### Live transcription -The single camera Live view in the Frigate UI supports live transcription of audio for streams defined with the `audio` role. Use the Enable/Disable Live Audio Transcription button/switch to toggle transcription processing. When speech is heard, the UI will display a black box over the top of the camera stream with text. The MQTT topic `frigate//audio/transcription` will also be updated in real-time with transcribed text. +The single camera Live view in the Frigate UI supports live transcription of audio for streams defined with the `audio` role. Use the Enable/Disable Live Audio Transcription button/switch to toggle transcription processing, or toggle it outside of the UI with the [`frigate//audio_transcription/set`](/integrations/mqtt#frigatecamera_nameaudio_transcriptionset) MQTT topic or the HTTP API. When speech is heard, the UI will display a black box over the top of the camera stream with text. The MQTT topic `frigate//audio/transcription` will also be updated in real-time with transcribed text. Results can be error-prone due to a number of factors, including: diff --git a/docs/docs/integrations/mqtt.md b/docs/docs/integrations/mqtt.md index 775adef3ea..08c3926ffd 100644 --- a/docs/docs/integrations/mqtt.md +++ b/docs/docs/integrations/mqtt.md @@ -390,6 +390,18 @@ Topic to turn audio detection for a camera on and off. Expected values are `ON` Topic with current state of audio detection for a camera. Published values are `ON` and `OFF`. +### `frigate//audio_transcription/set` + +Topic to turn [live audio transcription](/configuration/audio_detectors#live-transcription) for a camera on and off. Expected values are `ON` and `OFF`. Transcribed text is published to `frigate//audio/transcription`. + +`ON` is ignored unless audio transcription is enabled in the config for the camera. Unlike the other camera toggles, this one is not persisted across Frigate restarts. + +**NOTE:** Requires audio detection and transcription to be enabled + +### `frigate//audio_transcription/state` + +Topic with current state of live audio transcription for a camera. Published values are `ON` and `OFF`. + ### `frigate//recordings/set` Topic to turn recordings for a camera on and off. Expected values are `ON` and `OFF`. The change is persisted across Frigate restarts (see [Runtime toggle persistence](/configuration/live#runtime-toggle-persistence)). diff --git a/frigate/comms/mqtt.py b/frigate/comms/mqtt.py index 979fc6d6c0..b74d4284f9 100644 --- a/frigate/comms/mqtt.py +++ b/frigate/comms/mqtt.py @@ -77,6 +77,11 @@ class MqttClient(Communicator): "ON" if camera.audio.enabled_in_config else "OFF", retain=True, ) + self.publish( + f"{camera_name}/audio_transcription/state", + "ON" if camera.audio_transcription.live_enabled else "OFF", + retain=True, + ) self.publish( f"{camera_name}/detect/state", "ON" if camera.detect.enabled else "OFF", @@ -258,6 +263,7 @@ class MqttClient(Communicator): "snapshots", "detect", "audio", + "audio_transcription", "motion", "improve_contrast", "ptz_autotracker",