Skip to content

Commit

Permalink
Use ulaw as default audio codec #1236
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Jun 2, 2024
1 parent e0beed3 commit 13516e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/wyzebridge/wyze_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()}
Expand Down
2 changes: 1 addition & 1 deletion home_assistant/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 13516e7

Please sign in to comment.