Python MP3 Music Player Project Report
Python MP3 Music Player Project Report
ON
MUSIC PLAYER
(DEPARTMENT OF COMPUTER ENGINEERING)
To
Submitted by
1 Introduction
2 Company Overview
3 Existing System
5 Software Environment
6 Screen Shots
7 Conclusion
9 Bibliography
3
Introduction
Everybody loves listening music wouldn’t it be cool to have our very own mp3 music player.
So, in this python project, we are going to create an mp3 player with the help of python and
its libraries. Let’s start the python mp3 player project.
We will create an mp3 music player in which we can play the song, pause it, resume it, and
navigate from the current song to the next song as well as previous songs.
We will be using Python and its libraries. The first library that we will be using is Tkinter
which is a widely used GUI library offered by python, we do not have to install it separately,
as it comes with python itself.
Next, we will be using the mixer module of a very famous python library called Pygame.
Pygame is basically used to create video games, it includes computer graphics and sound
libraries. Mixer is one such sound library. Then, we will use the os library of python to
interact with the Operating system.
Project Prerequisites
A basic understanding of Tkinter widgets would also be required, but don’t worry as we will
be explaining every line of code as we go developing this mp3 player project.
Unlike the Tkinter library, we are required to install the Pygame library.
pygame is a Free and Open Source python programming language library for making
multimedia applications like games built on top of the excellent SDL (Simple DirectMedia
Layer) library. Simple DirectMedia Layer is a cross-platform development library designed
to provide low-level access to audio, keyboard, mouse, joystick, and graphics hardware via
OpenGL and Direct3D. Like SDL, pygame is highly portable and runs on nearly every
platform and operating system. Millions of people have downloaded pygame itself, which is a
whole lot of bits flying across the interwebs.
[Link] (the website) welcomes all Python game, art, music, sound, video and
multimedia projects.
Pygame requires Python. The best way to install pygame is with the pip tool (which is what
python uses to install packages). Note, this comes with python in recent versions. We use the
user flag to tell it to install into the home directory, rather than globally.
4
5
6
Existing system
7
Hardware requirements
SOFTWARE REQUIREMENTS
Python
Idle 3.9
Chrome
8
4. System Development Process
9
4.3. FEASIBILITY STUDY
Feasibility study is made to see if the project on completion will serve the purpose of the
organization for the amount of work, effort and the time that spend on it. Feasibility study
lets the developer foresee the future of the project and the usefulness. A feasibility study of
a system proposal is according to its workability, which is the impact on the
organization, ability to meet their user needs and effective use of resources. Thus when a
new application is proposed it normally goes through a feasibility study before it is
approved for development.
The document provide the feasibility of the project that is being designed and lists various
areas that were considered very carefully during the feasibility study of this project such as
Technical, Economic and Operational feasibilities.
TECHNICAL FEASIBILITY
The system must be evaluated from the technical point of view first. The assessment of this
feasibility must be based on an outline design of the system requirement in the terms of
input, output, programs and procedures. Having identified an outline system, the
investigation must go on to suggest the type of equipment, required method developing the
system, of running the system once it has been designed.
The project should be developed such that the necessary functions and performance
are achieved within the constraints. The project is developed within latest technology.
Through the technology may become obsolete after some period of time, due to the fact
that never version of same software supports older versions, the system may still be used.
So there are minimal constraints involved with this project. The system has been developed
using Java the project is technically feasible for development.
10
ECONOMIC FEASIBILITY
The developing system must be justified by cost and benefit. Criteria to ensure that effort is
concentrated on project, which will give best, return at the earliest. One of the factors,
which affect the development of a new system, is the cost it would require.
The following are some of the important financial questions asked during preliminary
investigation:
Since the system is developed as part of project work, there is no manual cost to spend
for the proposed system. Also all the resources are already available, it give an indication
of the system is economically possible for development.
BEHAVIORAL FEASIBILITY
The project would be beneficial because it satisfies the objectives when developed and
installed. All behavioral aspects are considered carefully and conclude that the project is
behaviorally feasible.
11
Coding Standard
The standard used in the development of the system is Microsoft Programming standards.
It includes naming conversions of variables, constants and objects, standardized formats or
labelling and commenting code, spacing, formatting and indenting.
Naming Convention
Classes’ names and interface names will start with capital letter. The function names will
start with small letters and the first letter of each word in the function name will be in capital
letter.
User Interface
For all the entry screen frames are used which will show the type of the user who is
currently logged in and the menus.
The method of implementation and the time scale to be adopted are found out initially.
Next the system is tested properly and the users are trained in the new procedures.
Implementation is the stage of the project where the theoretical design is turned into a
working system. It can be considered to be the most crucial stage in achieving a successful
new system gaining the users confidence that the new system will work and will be
effective and accurate. It is primarily concerned with user training and documentation.
Conversion usually takes place about the same time the user is being trained or later.
Implementation simply means convening a new system design into operation, which is the
process of converting a new revised system design into an operational one.
12
Implementation is the stage of the project where the theoretical design is tuned into a
working system. At this stage the main work load, the greatest upheaval and the major
impact on the existing system shifts to the user department. If the implementation is not
carefully planned and controlled it can create chaos and confusion.
Implementation includes all those activities that take place to convert from the existing
system to the new system. The new system may be a totally new, replacing an existing
manual or automated system or it may be a modification to an existing system. Proper
implementation is essential to provide a reliable system to meet organization requirements.
The process of putting the developed system in actual use is called system implementation.
This includes all those activities that take place to convert from the old system to the new
system. The system can be implemented only after through testing is done and if it is found
to be working according to the specifications. The system personnel check the feasibility of
the system. The more complex the system being implemented, the more involved will be
the system analysis and design effort required to implement the three main aspects:
education and training, system testing and changeover.
Careful planning.
Investigation of system and constraints.
Design of methods to achieve the changeover.
Training of the staff in the changeover phase.
Implementation Procedures
Implementation of software refers to the final installation of the package in its real
environment, to the satisfaction of the intended uses and the operation of the system. In
many organizations someone who will not be operating it, will commission the software
development project. In the initial stage people doubt about the software but we have to
ensure that the resistance does not build up, as one has to make sure that
The active user must be aware of the benefits of using the new system.
Their confidence in the software is built up.
Proper guidance is imparted to the user so that he is comfortable in
using the application.
13
Before going ahead and viewing the system, the user must know that for viewing the result,
the server program should be running in the server. If the server object is not up running on
the server, the actual process won’t take place.
User training is designed to prepare the user for testing and converting the system. To
achieve the objective and benefits expected from computer based system, it is essential for
the people who will be involved to be confident of their role in the new system. As system
becomes more complex, the need for training is more important. By user training the user
comes to know how to enter data, respond to error messages, interrogate the database and
call up routine that will produce reports and perform other necessary functions.
After providing the necessary basic training on computer awareness the user will have to be
trained on the new application software. This will give the underlying philosophy of the
use of the new system such as the screen flow, screen design type of help on the screen,
type of errors while entering the data, the corresponding validation check at each entry and
the ways to correct the date entered. It should then cover information needed by the
specific user/ group to use the system or part of the system while imparting the training of
the program on the application. This training may be different across different user groups
and across different levels of hierarchy.
Once the implementation plan is decided, it is essential that the user of the system is made
familiar and comfortable with the environment. Education involves right atmosphere and
motivating the user. A documentation providing the whole operations of the system is
being developed in such a way that the user can work with it in well consistent way. The
system is developed user friendly so that the user can work the system from the tips given
in the application itself. Useful tip and guidance is given inside the application itself to help
the user. Users have to be made aware that what can be achieved with the new system and
how it increases the performance of the system. The user of the system should be given a
general idea of the system before he uses the system.
14
4.8. System Maintenance
Maintenance is the enigma of system development. The maintenance phase of the software
cycle is the time in which a software product performs useful work. After a system is
successfully implemented, it should be maintained in a proper manner. System
maintenance is an important aspect in the software development life [Link] need for
system maintenance is for it to make adaptable to the changes in the system environment.
Software maintenance is of course, far more than "FindingMistakes". Maintenance may be
defined by describing four activities that are undertaken after a program is released for use.
15
DATABASE DESIGN
The database design is a two level process. In the first step, user requirements are gathered
together and a database is designed which will meet these requirements as clearly as
possible. This step is called Information Level Design and it is taken independent of any
individual DBMS.
In the second step, this Information level design is transferred into a design for the specific
DBMS that will be used to implement the system in question. This step is called Physical
Level Design, concerned with the characteristics of the specific DBMS that will be used. A
database design runs parallel with the system design. The organization of the data in the
database is aimed to achieve the following two major objectives:
o Data Integrity
o Data independence
To structure the data so that there is no repetition of data, this helps insaving.
A table is a relation. The rows in a table are called tuples. A tuple is an ordered set of n
elements. Columns are referred to as attributes. Relationships have been set between every
table in the database. This ensures both Referential and Entity Relationship Integrity. A
domain D is a set of atomic values. A common method of specifying a domain is to specify
a data type from which the data values forming the domain are drawn. It is also useful to
specify a name for the domain to help in interpreting its values. Every value in a relation is
atomic, that is not decomposable.
RELATIONSHIPS:
o Table relationships are established using Key. The two main keys of prime
importance are Primary Key & Foreign Key
o Entity Integrity enforces that no Primary Key can have null values.
o Referential Integrity enforces that no Primary Key can have null values.
o Referential Integrity for each distinct Foreign Key value, there must exist a
matching Primary Key value in the same domain. Other key are Super Key and
Candidate Keys.
o Relationships have been set between every table in the database.
NORMALIZATION:
As the name implies, it denoted putting things in the normal form. The application
developer via normalization tries to achieve a sensible organization of data into proper
tables and columns and where names can be easily correlated to the data by the user.
Normalization eliminates repeating groups at data and thereby avoids data redundancy
which proves to be a great burden on the computer resources. These includes:
Normalize the data.
Choose proper names for the tables and columns.
Choose the proper name for the data.
The First Normal Form states that the domain of an attribute must include only atomic
values and that the value of any attribute in a tuple must be a single value from the domain
of that attribute. In other words 1NF disallows “relations within relations” or “relations as
attribute values within tuples”. The only attribute values permitted by 1NF are single
atomic or indivisible values.
17
The first step is to put the data into First Normal Form. This can be donor by moving data
into separate tables where the data is of similar type in each table. Each table is given a
Primary Key or Foreign Key as per requirement of the project. In this we form new
relations for each nonatomic attribute or nested relation. This eliminated repeating groups
of data.
A relation is said to be in first normal form if only if it satisfies the constraints that contain
the primary key only.
According to Second Normal Form, for relations where primary key contains multiple
attributes, no nonkey attribute should be functionally dependent on a part of the primary
key.
In this we decompose and setup a new relation for each partial key with its dependent
attributes. Make sure to keep a relation with the original primary key and any attributes
that are fully functionally dependent on it. This step helps in taking out data that is only
dependant on apart of the key.
A relation is said to be in second normal form if and only if it satisfies all the first normal
form conditions for the primary key and every non-primary key attributes of the relation is
fully dependent on its primary key alone.
According to Third Normal Form, Relation should not have a nonkey attribute
functionally determined by another nonkey attribute or by a set of nonkey attributes. That
is, there should be no transitive dependency on the primary key.
In this we decompose and set up relation that includes the nonkey attributes that
functionally determines other nonkey attributes. This step is taken to get rid of anything
that does not depend entirely on the Primary Key.
A relation is said to be in third normal form if only if it is in second normal form and more
over the non key attributes of the relation should not be depend on other non key attribute.
18
Testing
Testing is the process of exercising software with the intent of finding errors and ultimately
correcting them. The following testing techniques have been used to make this project free
of errors. Content Review The whole content of the project has been reviewed thoroughly
to uncover typographical errors, grammatical error and ambiguous sentences. Navigation
Errors Different users were allowed to navigate through the project to uncover the
navigation errors. The views of the user regarding the navigation flexibility and user
friendliness were taken into account and implemented in the project. Unit Testing Focuses
on individual software units, groups of related units. Unit – smallest testable piece of
software. A unit can be compiled /assembled / linked/loaded; and put under a test harness.
Unit testing done to show that the unit does not satisfy the application and /or its
implemented software does not match the intended designed structure. Integration Testing
Focuses on combining units to evaluate the interaction among them.
19
Python
What is Python?
Python is a popular programming language. It was created by Guido van Rossum, and
released in 1991.
It is used for:
Why Python?
Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
Python has a simple syntax similar to the English language.
Python has syntax that allows developers to write programs with fewer lines
than some other programming languages.
Python runs on an interpreter system, meaning that code can be executed as
soon as it is written. This means that prototyping can be very quick.
Python can be treated in a procedural way, an object-orientated way or a functional
way.
20
Good to know
The most recent major version of Python is Python 3, which we shall be using in
this tutorial. However, Python 2, although not being updated with anything other
than security updates, is still quite popular.
In this tutorial Python will be written in a text editor. It is possible to write
Python in an Integrated Development Environment, such as Thonny, Pycharm,
Netbeans or Eclipse which are particularly useful when managing larger
collections of Python files.
Python was designed for readability, and has some similarities to the English
language with influence from mathematics.
Python uses new lines to complete a command, as opposed to other
programming languages which often use semicolons or parentheses.
Python relies on indentation, using whitespace, to define scope; such as the scope
of loops, functions and classes. Other programming languages often use curly-
brackets for this purpose.
Python Install
To check if you have python installed on a Windows PC, search in the start bar for
Python or run the following on the Command Line ([Link]):
To check if you have python installed on a Linux or Mac, then on linux open the command
line or on Mac open the Terminal and type:
python --version
If you find that you do not have python installed on your computer, then you can
download it for free from the following website: [Link]
21
Python Quickstart
Python is an interpreted programming language, this means that as a developer you write
Python (.py) files in a text editor and then put those files into the python interpreter to be
executed.
The way to run a python file is like this on the command line:
Let's write our first Python file, called [Link], which can be done in any text editor.
[Link]
Run example »
Simple as that. Save your file. Open your command line, navigate to the directory where
you saved your file, and run:
Hello, World!
Congratulations, you have written and executed your first Python program.
22
Python Syntax
As we learned in the previous page, Python syntax can be executed by writing directly in the
Command Line:
>>>print("Hello, World!")
Hello, World!
Or by creating a python file on the server, using the .py file extension, and running it
in the Command Line:
Python Indentations
Where in other programming languages the indentation in code is for readability only, in
Python the indentation is very important.
Example
if 5 > 2:
print("Five is greater than two!")
Run example »
23
Example
if 5 > 2:
print("Five is greater than two!")
Run example »
Comments
Comments start with a #, and Python will render the rest of the line as a comment:
Example
Comments in Python:
#This is a comment.
print("Hello, World!")
Run example »
Docstrings
Python also has extended documentation capability, called docstrings. Docstrings can be
Python uses triple quotes at the beginning and end of the docstring:
Example
24
"""This is a
Run example »
25
Python Variables
Creating Variables
Unlike other programming languages, Python has no command for declaring a variable.
Example
x=5
y = "John"
print(x) print(y)
Run example »
Variables do not need to be declared with any particular type and can even change type after
they have been set.
Example
x = 4 # x is of type int
x = "Sally" # x is now of type str print(x)
Run example »
Variable Names
A variable can have a short name (like x and y) or a more descriptive name (age,
carname, total_volume). Rules for Python variables:
26
A variable name can only contain alpha-numeric characters and
underscores (A-z, 0-9, and _ )
Variable names are case-sensitive (age, Age and AGE are three different variables)
Output Variables
Example
x = "awesome"
print("Python is " + x)
Run example »
You can also use the + character to add a variable to another variable:
Example
x = "Python is "
y = "awesome"
z = x + y
print(z)
Run example »
27
Example
x=5
y = 10
print(x + y)
Run example »
If you try to combine a string and a number, Python will give you an error:
Example
x=5
y = "John"
print(x + y)
Run example »
28
Python – Loops
Programming languages provide various control structures that allow for more
complicated execution paths.
1 while loop
29
condition before executing the loop body.
2 for loop
Executes a sequence of statements multiple times and abbreviates the code that
manages the loop variable.
3 nested loops
You can use one or more loop inside any another while, for or do..while loop.
Python supports the following control statements. Click the following links to check their
1 break statement
2 continue statement
Causes the loop to skip the remainder of its body and immediately retest its
condition prior to reiterating.
3 pass statement
30
SCREENSHOT
31
Conclusion
Conclusions while trying to initalize the BRAMs in the hardware design it was discovered
that MicroBlaze addressing is byte oriented while we wanted to write complete 32bit
words. So when incrementing a pointer it adds 4 to the address. This means that the 2 least
significant bits from the BRAM controller to the hardware memories should be thrown
away. The initialization data, bitmap and palette data, that is loaded on to hardware in the
initialization phase of the software occupies twice the BRAM on the FPGA as needed. The
RAM is allocated by the graphics accelerator and then it’s programmed into the
MicroBlaze BRAM on programming. This would of course have been better to store in
non-volatile memory. Since it is only loaded once and has no speed requirements. The
main part of the MicroBlaze BRAM is occupied by .text i.e. the instructions, about 30kB.
Since MicroBlaze is configured with 32 kB this means that almost all the BRAM is
occupied with instructions. It would ofcourse be better to store in an larger external
memory accessing using an instruction cache. This would have made it possible to place
heap and stack in BRAM instead of placing it on the slow PSRAM. Which would have
been a much neater design. A lot of problems encountered were probably misjudged and it
might not even been errors. This due to to poor testing. For exmaple ill thought testing
data generating an output thought to be wrong. When it might have been right. The lesson
we learned is to construct well defined tests, where the expected output is known. One of
this incidents is described below: The hardware was designed with AXI bus, and therefore
a new IP core provided by digilent to interface the external memories was used, called
Digilent mem bus mux. But this core has no documentation what so ever. For example it
outputs a 17 bit databus. The bugs this introduced was probaby software related since we
now using it with correct behavior. But we still miss some documentation describing this
ip core. Similar problem occured when first testing the hardware with some "random"
input data to the background memory.
32
Bibliography
BOOKS:
Press
Ian Somerville ‘Software engineering’
Rajeev mall ‘Software engineering’
ElmasriNavathe ‘Fundamentals of database systems’
33