
    Pmj                    @    d Z ddlmZ ddlZddlZddlmZ d Zd	dZdS )
uw  Shared ffmpeg executable discovery for Discord voice paths.

Discovery itself is owned by ``tools.transcription_tools`` (the same helper
the STT pipeline uses — PATH plus common Homebrew/local prefixes); this module
only layers the Discord-voice-specific extras on top: an explicit
``FFMPEG_PATH`` override and a Windows winget fallback for installs that
never touch PATH.
    )annotationsN)Pathc                 n    	 ddl m}  n$# t          $ r t          j        d          cY S w xY w |             S )zBDelegate to the repo-wide ffmpeg discovery helper when importable.r   _find_ffmpeg_binaryffmpeg)tools.transcription_toolsr   ImportErrorshutilwhichr   s    L/home/thesage/.hermes/hermes-agent/plugins/platforms/discord/ffmpeg_utils.py_shared_find_ffmpegr      s\    &AAAAAAA & & &|H%%%%%&   s   	 **returnstrc                    t          j        d          } | rb|                                 rNt           j                            t           j                            |                                                     S t                      }|r|S t          j        d          }|rQt          |          dz  dz  dz  }t          |	                    d                    }|rt          |d                   S dS )	zBReturn an ffmpeg command that also covers common Windows installs.FFMPEG_PATHLOCALAPPDATA	MicrosoftWinGetPackageszGyan.FFmpeg_*/*/bin/ffmpeg.exer   )osgetenvstrippath
expandvars
expanduserr   r   sortedglobr   )explicit
discoveredlocal_appdatapackages_dir
candidatess        r   resolve_ffmpeg_executabler%      s    y''H HHNN$$ Hw!!"'"4"4X^^5E5E"F"FGGG$&&J In--M 'M**[88CjPL--.NOOPP
 	'z"~&&&8    )r   r   )	__doc__
__future__r   r   r   pathlibr   r   r%    r&   r   <module>r+      st     # " " " " " 				       ! ! !     r&   