Summary
On Windows, VLC_AVAILABLE is always False despite VLC being installed, because the python-vlc bindings package (vlc.py) is not included in the PyInstaller bundle. This causes YouTube audio playback to silently fall back to BASS (sound_lib), which cannot handle WebM/Opus stream URLs returned by yt-dlp's bestaudio/best selector, resulting in BASS error code 41 (BASS_ERROR_FILEFORM — unsupported file format).
Root Cause
In sound.py, the VLC availability check is:
try:
import vlc
_test_instance = vlc.Instance('--quiet')
...
VLC_AVAILABLE = True
except Exception:
VLC_AVAILABLE = False
The import vlc fails silently because vlc.py (from the python-vlc package) is not present in _internal/ in the Windows PyInstaller build. All exceptions are swallowed, so there is no indication to the user or developer that VLC detection failed for this reason rather than VLC not being installed.
Steps to Reproduce
- Install FastSM on Windows using the official installer
- Ensure VLC is installed at the standard path (
C:\Program Files\VideoLAN\VLC)
- Attempt to play a YouTube link from a post in FastSM
- Observe error 41 / no audio playback
Workaround
Manually installing the python-vlc bindings into _internal resolves the issue completely:
pip install python-vlc --target <any folder>
copy vlc.py "C:\Program Files\FastSM\_internal\"
After restarting FastSM, VLC_AVAILABLE becomes True and YouTube audio plays correctly via VLC.
Suggested Fix
Add python-vlc to the Windows PyInstaller build dependencies so that vlc.py is included in _internal/ automatically. Since python-vlc is a pure Python package (py3-none-any), it has no compiled components and should bundle without issues.
In build.py, this likely means adding python-vlc to the Windows requirements or adding an explicit --collect-submodules / --hidden-import vlc entry in the PyInstaller spec for the Windows build path.
The version used in testing and confirmed working: python-vlc 3.0.21203 with VLC 3.0.23.
Environment
- OS: Windows 11 25H2
- FastSM version: 0.5.0
- VLC version: 3.0.23 (installed at default path)
- python-vlc version that resolves the issue: 3.0.21203
Summary
On Windows,
VLC_AVAILABLEis alwaysFalsedespite VLC being installed, because thepython-vlcbindings package (vlc.py) is not included in the PyInstaller bundle. This causes YouTube audio playback to silently fall back to BASS (sound_lib), which cannot handle WebM/Opus stream URLs returned by yt-dlp'sbestaudio/bestselector, resulting in BASS error code 41 (BASS_ERROR_FILEFORM— unsupported file format).Root Cause
In
sound.py, the VLC availability check is:The
import vlcfails silently becausevlc.py(from thepython-vlcpackage) is not present in_internal/in the Windows PyInstaller build. All exceptions are swallowed, so there is no indication to the user or developer that VLC detection failed for this reason rather than VLC not being installed.Steps to Reproduce
C:\Program Files\VideoLAN\VLC)Workaround
Manually installing the
python-vlcbindings into_internalresolves the issue completely:After restarting FastSM,
VLC_AVAILABLEbecomesTrueand YouTube audio plays correctly via VLC.Suggested Fix
Add
python-vlcto the Windows PyInstaller build dependencies so thatvlc.pyis included in_internal/automatically. Sincepython-vlcis a pure Python package (py3-none-any), it has no compiled components and should bundle without issues.In
build.py, this likely means addingpython-vlcto the Windows requirements or adding an explicit--collect-submodules/--hidden-import vlcentry in the PyInstaller spec for the Windows build path.The version used in testing and confirmed working:
python-vlc 3.0.21203with VLC3.0.23.Environment