pythonwindowsspeech-recognitionspyderflac

FLAC conversion utility not available - consider installing the FLAC command line application on Spyder/Windows 10


I'm working on a speech recognition and following the example shown in this PythonCode page on Windows 10 with Spyder 5.1.5/Anaconda (Python 3.8.10).

I installed SpeechRecognition and pydub with conda install -c conda-forge, and when I run the following script:

with sr.AudioFile(filename) as source:
    audio_data = r.record(source)
    text = r.recognize_google(audio_data)
    print(text)

or more specifically (text = r.recognize_google(audio_data)), this error message shows up:

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

There's a similar question but I couldn't find the solution for the Windows environment where I don't have apt-get install flac or brew.

Following this post, I've downloaded the flac.exe file and placed under C:\Windows\System32. I can run flac on command line, but the same error shows up when I run the python script.

Does anyone know how to fix this problem?


Solution

  • According to the source code it is searching for a flac without exe extension that will not work in Windows. If that fails it looks for a file with a specific name (flac-win32.exe) in module folder.

    You can either try to remove the extension of the file in the System32 folder or put the file in the module folder.