ChatTTS-Forge / modules /ffmpeg_env.py
zhzluke96
update
627d3d7
raw
history blame
427 Bytes
import os
from modules.utils.constants import ROOT_DIR
import logging
logger = logging.getLogger(__name__)
def setup_ffmpeg_path():
ffmpeg_path = os.path.join(ROOT_DIR, "ffmpeg")
os.environ["PATH"] = ffmpeg_path + os.pathsep + os.environ["PATH"]
import pydub.utils
if pydub.utils.which("ffmpeg") is None:
logger.error("ffmpeg not found in PATH")
raise Exception("ffmpeg not found in PATH")