Mp3 Player using Python

Published on . Written by

Mp3 Player using Python
Most of us don't go anywhere without our headphones because we can't imagine a long bus journey or wait without listening to music. Headphone sales and music sales have never been higher before, and this just proves how dependent we are on our music. MP3 players are hence a must-have for almost every millennial now, and hence is a great option for a field to invest time studying. Here’s a look at a simple Python program that will work as an MP3 Player.

Read more..
Project Description


Skyfi Labs Projects
In this project, we will be trying to build a simple interface that will help users play, pause and stop a track as per their needs. The application will also help users choose areas within the track and also increase the volume of their device. We will also try to add more features such as displaying the name of the artist, album name and track title, and even displaying the album art. So, let’s get started!

Concepts Used

  • Programming Basics
  • Python Programming
  • Database Management
  • Algorithm Construction
  • Data Processing
Requirements

  1. An updated OS which may be Windows/Linux/Mac
  2. Python 2 and above installed
  3. Required Python libraries installed
  4. Adequate RAM and HD space
Project Implementation

  • First and foremost, you need to select a suitable layout. There are various styles you could opt for, and the design side of things is purely up to you.
  • You could go with a traditional walkman style wherein a horizontal trackbar will display at which portion of the song you are at, and can be slid either way to control your MP3 player. Underneath this horizontal bar is where you could place your buttons for moving to the next song starting over and also volume changes.
  • If not, you could go with a more futuristic style, where a circular disc contains the track information, with the left-hand side having a vertical bar that tracks the volume, and the circular disc containing information about where within the track the player is at presently.
  • If you are using pre-loaded Python modules or widgets, then for such an interface your best option would be ShapedButtons.
  • But bear in mind that this wxpython extension depends on the Python Imaging Library better known as PIL.
  • This might bring up problems for beginners, and hence, may be the best option for people who are just starting out would be to use generic buttons available in python rather than importing or utilizing an entire pre-set module.
  • When you use wxPython to build this player, you need to make sure it is cross-platform compatible. This means that the device will use ffdshow while running on Windows XP, will rely on Windows Media Player when running on Windows 7, and utilize GStreamer for back-end operations when running on Linux.
  • Another option you have is to use the Andrea Gavana ShapedButton widget for the controls of your MP3 player. SVN version of this widget may be found in official wxPython repositories and is the preferred version, as the one that comes in-built into wx has several bugs in it.
  • If you are still using the pre-built function, then make sure you copy the wxPython Demo application bitmaps to the right source location as the widget relies on those bitmaps to function.
  • Initialize a few global variables which can hold the address or directory path of the bitmap folder.
  • Next, build the UI of the player using the widgets and functions listed above.
  • Since most people download their songs into either Music or Downloads, make use of wx.StandardPaths to find that folder and set it as the attribute for a currentFolder function.
  • This function will bring up the last opened folder whenever we use the MP3 player or browse through the music in it so that users can easily find their songs.
  • Next, design and incorporate a timer into the interface to track the song’s length and display it. You can use the code provided in the wxPython’s MediaCtrl tab for this function.
  • Use a basic layoutControls function to align, add and size the necessary widgets and handle the layout duties.
  • Now, all you need to do is go to your Music folder, pick a song of your choosing and hit play!
Kit required to develop Mp3 Player using Python:
Technologies you will learn by working on Mp3 Player using Python:


Any Questions?


Subscribe for more project ideas