A simple yet powerful music player built with PyQt5 and QtMultimedia, designed for Linux desktops. Enjoy your favorite tunes with a clean and intuitive interface.
- Audio Playback: Supports common audio formats (MP3, OGG, FLAC, WAV, etc., depending on system GStreamer codecs).
- Playlist Management: Basic playlist functionality
- Simple UI: Straightforward controls for play, pause, stop, next, previous
- Lightweight: Packaged for minimal dependencies.
You have a few options to get and run My Music Player on your Linux system:
This is the easiest way to get the player running without installing any development tools.
-
Download the Executable: Go to the Releases page of this repository. Download the latest
music-playerexecutable file from the "Assets" section of the desired release. -
Make it Executable: Open your terminal, navigate to the directory where you downloaded the file, and make it executable:
chmod +x music-player
-
Run the Player: You can now run the application directly:
./music-player
Compatibility Note: This binary was built on Arch Linux and is expected to work on most modern Linux Distribution. Compatibility with other distributions (e.g., Fedora, Arch) may vary depending on system libraries, especially GStreamer.
This script automates copying the executable and creating a desktop entry, making it appear in your application menu.
-
Download Release Assets: Go to the Releases page and download:
- The
music-playerexecutable - The
simple-music-player.desktopfile - The
install.shscript Place them in the same directory (e.g., a new folder namedMyMusicPlayer).
- The
-
Make Script Executable: Open your terminal, navigate to the directory where you downloaded the files, and make the script executable:
chmod +x install.sh
-
Run the Installation Script: Execute the script. It will copy the necessary files to your local
~/.local/binand~/.local/share/applicationsdirectories../install.sh
You should now find "Simple music player" in your desktop environment's application menu.
If you want to contribute, customize, or understand the internals, you can build the application from its source code.
- Python 3.8+
- pip (Python package installer)
- PyQt5 (Python bindings for Qt)
- PyInstaller (for packaging)
- GStreamer 1.0 and its plugins (essential for QtMultimedia on Linux). Ensure you have packages like
gstreamer1.0-plugins-base,gstreamer1.0-plugins-good,gstreamer1.0-plugins-bad,gstreamer1.0-libav,gstreamer1.0-alsa, etc., installed on your system.
-
Clone the Repository:
git clone https://github.com/KISHOREkevin/simple-music-player.git cd simple-music-player -
Create and Activate a Virtual Environment (Recommended):
python3 -m venv .venv source .venv/bin/activate -
Install Dependencies:
pip install -r requirements.txt
-
Run from Source (without PyInstaller build): If you just want to run the Python script directly (for development):
python music-player.py
-
Build the Executable with PyInstaller: This project uses PyInstaller to create a standalone executable. The
.specfile (music-player.spec) contains all the necessary configurations for bundling QtMultimedia's GStreamer dependencies.First, generate the
.specfile (if you don't have it locally or if it's not committed):pyinstaller --onefile --windowed music-player.py
Then, build using the
.specfile (recommended as it includes custom paths):pyinstaller music-player.spec
Alternatively, if you prefer to use the command directly: (Make sure these paths
YOUR_QT_PLUGINS_PATHandYOUR_GSTREAMER_LIB_PATHare correct for your system. Usefind /usr -name "libgstreamer-1.0.so*"andls -lto verify.)pyinstaller --onefile --windowed \ --add-data "/usr/lib/qt/plugins/mediaservice:PyQt5/Qt/plugins/mediaservice" \ --add-data "/usr/lib/qt/plugins/platforms:PyQt5/Qt/plugins/platforms" \ --add-data "/usr/lib/gstreamer-1.0:gstreamer-1.0" \ --add-binary "/usr/lib/libgstreamer-1.0.so:." \ --add-binary "/usr/lib/x86_64-linux-gnu/libgstbase-1.0.so:." \ --add-binary "/usr/lib/x86_64-linux-gnu/libgstapp-1.0.so:." \ music-player.pyThe final executable will be in the
dist/directory.
If you downloaded the binary directly and prefer not to use the install.sh script, you can manually create a .desktop file for better desktop integration.
-
Place your executable and icon: Move
music-playerto a permanent location, e.g.,~/bin/or~/.local/bin/. -
Create the
.desktopfile: Open a text editor and save the following content asmusic-player.desktopin~/.local/share/applications/:[Desktop Entry] Name=Simple Music Player Comment=A simple music player application Exec=/home/YOUR_USERNAME/bin/music-player # <--- IMPORTANT: Replace with the actual path to your executable Terminal=false Type=Application Categories=AudioVideo;Player; StartupNotify=true Keywords=music;player;audio;mp3;
Remember to replace
/home/YOUR_USERNAME/...with your actual paths! -
Make it Executable:
chmod +x ~/.local/share/applications/music-player.desktop -
Update Desktop Database (Optional):
update-desktop-database ~/.local/share/applications/
- Also play music directly by giving file as an argument to the command
music-player. - Like
music-player [path-to-music-file] - for example:
- if its
./music-playerbinary file,./music-player music.mp3
- if its an command,
music-player music.mp3
- if its
-
GStreamer-WARNING: External plugin loader failed...: This is a common warning when bundling GStreamer-based applications with PyInstaller--onefile. If your application functions correctly (i.e., plays music), you can generally ignore this warning. It indicates that the GStreamer plugin scanner couldn't run, but the necessary plugins are still being found and loaded. -
"no element 'identity'" or "No QtMultimedia backends found": These errors mean that the GStreamer plugins required by QtMultimedia are not being found by your packaged application.
- Solution: Ensure your system has the core GStreamer packages installed (e.g.,
gstreamer1.0-plugins-good,gstreamer1.0-libav). If building from source, double-check yourpyinstallercommand to ensure allgstreamer-1.0plugin directories and core libraries are correctly included via--add-dataand--add-binaryflags, matching the paths on your build system.
- Solution: Ensure your system has the core GStreamer packages installed (e.g.,
Contributions are welcome! If you find a bug or have a feature request, please open an issue. If you'd like to contribute code, feel free to fork the repository and submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
We extend our sincere gratitude to the following projects and communities whose incredible work made My Awesome Music Player possible:
- PyQt Project: For providing the robust and versatile Python bindings for the Qt application framework, enabling the creation of powerful graphical user interfaces.
- PyInstaller: For its invaluable role in effortlessly packaging this Python application into a standalone executable, simplifying distribution to end-users.
- Qt Project: The foundational C++ framework that empowers the entire application, offering comprehensive multimedia capabilities and cross-platform compatibility.
- GStreamer: The powerful multimedia framework on Linux that QtMultimedia leverages, providing the necessary codecs and backend infrastructure for audio playback.
Kishore Kevin
Portfolio | github | LinkedIn |
Youtube Channel
Your open-source contributions are truly appreciated!
