Objective
Play audio with VLC in Python.
Distributions
This will work on any Linux distribution
Requirements
A working Linux install with Python and VLC.
Difficulty
Easy
Conventions
- # – requires given linux commands to be executed with root privileges either directly as a root user or by use of
sudo
command
- $ – requires given linux commands to be executed as a regular non-privileged user
Introduction
There are plenty of ways to play audio files with Python. It really depends on your application, but the easiest way, by far, is to use the bindings for VLC to control VLC with Python, and play your files.
With VLC, you don’t need to worry about codecs and file support. It also doesn’t require too many complicated methods, and/or objects. So, for simple audio playback, VLC is best.
Read more