프로그래밍/개인 프로젝트

Speechrecognition flac 에러

무연 2023. 3. 23. 18:33

사용 환경 : windows anaconda

 

에러 내용

window Exception: FLAC conversion utility not available - consider installing the FLAC command line application by running `apt-get install flac` or your operating system's equivalent

 

Windows anaconda 해결 방법

1.윈도우에 맞는 파일 다운로드

https://ftp.osuosl.org/pub/xiph/releases/flac/

 

https://ftp.osuosl.org/pub/xiph/releases/flac/

Oregon State University Open Source Lab Mirrors

ftp.osuosl.org

가장 최신버전인 1.4.2 버전을 다운받았습니다.

 

압축

 

세가지 파일을

C:\Windows\System32 경로에 붙여놓습니다.

flac.exe 한번 실행해 줍니다.

 

2. 파일 수정

C:\Users\사용자명\anaconda3\envs\프로젝트명\Lib\site-packages\speech_recognition  

( 빨간색 부분은 본인 환경에 맞게 수정해 주셔야 합니다.)

 

에서 get_flac_converter() 함수 있는 파일을 찾습니다.

저의 경우 audio.py 였습니다.

flac -> flac.exe 로 변경해 줍니다.

변경

 

def get_flac_converter():

    """Returns the absolute path of a FLAC converter executable, or raises an OSError if none can be found."""

    flac_converter = shutil_which("flac")  # check for installed version first

 

변경

def get_flac_converter():

    """Returns the absolute path of a FLAC converter executable, or raises an OSError if none can be found."""

    flac_converter = shutil_which("flac.exe")  # check for installed version first

 

위 과정을 거치면 정상적으로 작동됩니다.

 

 

참고 : https://stackoverflow.com/questions/70610033/flac-conversion-utility-not-available-consider-installing-the-flac-command-lin