From 13516e7e73adbd853c60252625dc2efc87316ddb Mon Sep 17 00:00:00 2001 From: mrlt8 <67088095+mrlt8@users.noreply.github.com> Date: Sun, 2 Jun 2024 07:11:10 -0700 Subject: [PATCH] Use ulaw as default audio codec #1236 --- app/wyzebridge/wyze_stream.py | 4 ++-- home_assistant/config.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/wyzebridge/wyze_stream.py b/app/wyzebridge/wyze_stream.py index 159b9e8a..ae2187a9 100644 --- a/app/wyzebridge/wyze_stream.py +++ b/app/wyzebridge/wyze_stream.py @@ -14,7 +14,7 @@ from typing import Optional from wyzebridge.bridge_utils import env_bool, env_cam -from wyzebridge.config import BRIDGE_IP, COOLDOWN, MQTT_TOPIC +from wyzebridge.config import COOLDOWN, MQTT_TOPIC from wyzebridge.ffmpeg import get_ffmpeg_cmd from wyzebridge.logging import logger from wyzebridge.mqtt import publish_discovery, publish_messages, update_mqtt_state @@ -552,7 +552,7 @@ def get_audio_params(sess: WyzeIOTCSession) -> dict[str, str | int]: if codec_out := env_bool("AUDIO_CODEC"): logger.info(f"[AUDIO] Re-Encode Enabled [AUDIO_CODEC={codec_out}]") elif rate > 8000 or codec.lower() == "s16le": - codec_out = "libopus" if BRIDGE_IP else "aac" + codec_out = "pcm_mulaw" logger.info(f"[AUDIO] Re-Encode for RTSP compatibility [{codec_out=}]") return {"codec": codec, "rate": rate, "codec_out": codec_out.lower()} diff --git a/home_assistant/config.yml b/home_assistant/config.yml index 05e01ab3..ace57402 100644 --- a/home_assistant/config.yml +++ b/home_assistant/config.yml @@ -65,7 +65,7 @@ schema: MOTION_START: bool? MOTION_WEBHOOKS: str? SUBSTREAM: bool? - AUDIO_CODEC: list(COPY|AAC|MP3|LIBOPUS)? + AUDIO_CODEC: list(COPY|AAC|LIBOPUS|MP3|PCM_MULAW|PCM_ALAW)? AUDIO_FILTER: str? LLHLS: bool? DISABLE_CONTROL: bool?