You are on page 1of 24

Project report on

Music Player System

Semester :5th

Department : Computer Engineering


Submitted to

GOVERNMENT POLYTECHNIC, NANDURBAR

Under the guidance of

Prof. M. P. Vasave sir lecturer in


Advance Java (22517)

Government Polytechnic, Nandurbar.


MAHARASHTRA STASTE BOARD OF TECHNICAL
EDUCATION
CERTIFICATE

This is certify that Mr. / Miss. ……………………………………….....Roll No ..............


Fifth semester of Diploma in computer Engineering of institute Government
Polytechnic, Nandurbar has completed the Micro Project satisfactorily in the
subject Advance Java (22517) for the Academic Year 2022-2023 as prescribed
in the curriculum.

PLACE: ENROLLMENT NO:

DATE: EXAM SEAT NO:

Subject Teacher Head of the Department Principal

Seal of
Institution
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION,MUMBAI
Evaluation sheet for the Micro project

Academic Year: 2022-23 Semester: Fifth

Course: Advance Java Course code: 22517


Title of Project : “Music Player System”

Roll No Name of Student


3119 Sanika Sanjay Deore
3143 Unnati Sudhakar Surywanshi
3148 Tejaskumar Dilip Girnar
3154 Devam Nilesh Shroff
CONTENTS

SR NO CONTENT PAGE NO
01 Introduction 05
02 What is a renewable energy source? 06
03 Solar energy 07
04 Wind energy 09
05 Hydro energy 10
06 Geothermal energy 18
07 Biomass energy 21
08 Tidal energy
09 Conclusion , References
07 Weekly work/Progress Report 22
07 Nanexure-II 23
08 COs address by the Microproject 24
Introduction
Java is a class-based, object-oriented programming language that is created to have as little execution
reliance as possible. It is a general-purpose programming language planned to let application
developers write once, and run anywhere (WORA), meaning that compiled Java code can run on all
platforms that support Java without the requirement for recompilation. Java applications are generally
compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying
computer architecture. The syntax of Java is identical to C and C++ but has fewer low-level facilities
than either of them. The Java runtime delivers dynamic abilities (such as reflection and runtime code
modification) that are generally not available in traditional compiled languages.

Java was initially developed by James Gosling at Sun Microsystems (which has since
been accepted by Oracle) and released in 1995 as a core component of Sun Microsystems'
Java platform. The actual and reference implementation of Java compilers, virtual machines, and
class libraries were initially released by Sun under proprietary licenses. As of May 2007, in
compliance with the specifications of the Java Community Process, Sun had relicensed most of its
Java technologies under the GNU General Public License. Oracle offers its own HotSpot Java
Virtual Machine, however, the official reference implementation is the OpenJDK JVM which is free
open source software utilized by most developers and is the default JVM for almost all
Linux distributions.

Music Player lets you control all your music files fast and easily. This audio player supports nearly all
kinds of mp3, midi,wav, FLAC raw aac files, and additional audio formats . Easily browse and play
music songs by genres, albums, artists, songs, and folders. Media is a crucial factor in our lives. We
are making a media player using java to handle all the music requirements of the user.

James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in
June 1991. Java was initially developed for interactive television, but it was too advanced for the
digital cable television industry at the time. The language was originally called Oak after an oak tree
that stood outside Gosling's office. Later the project went by the name Green and was eventually
renamed Java,

from Java coffee, the coffee from Indonesia. Gosling designed Java with a C/C++-style syntax
that system and application programmers would find familiar.
Aims/Benefits of the micro project

Java technology is widely used for web application development. Based on the object-oriented
concepts and core Java concepts, this course will equip the students with the required knowledge and
skill of object-oriented programming approach needed for the development of robust, powerful web
applications. Through this course, students will get hands-on experience on GUI Technologies viz.
AWT and Swings, event handling mechanisms and network programming. The course also gives
coverage to various web application aspects like Database Interaction, server-side components, and
servlets.

Course outcome addressed.

1. Develop programs to handle events in Java Programming.


2. Develop programs using GUI Framework (AWT and Swing).

Proposed methodology

Create a music player using a java programming language that helps to play music.
Hardware Requirements

System : Ryzen
Frequency : 3.0 GHz
RAM : 8 GB
ClockLayoutDis
k Capacity : 500 GB

Software Requirements

Operating System : WINDOWS 11


Compiler, IDE : NetBeans
FLOWCHART

START

SHOW LIST OF SD FILES

SELECT FILE

AUDIO PLAYER

PLAY

PAUSE

Rewind

Fast Forward

END
SYSTEM PROCESS / DESIGN OF MUSIC PLAYER
Code

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package com.dataflair.mp3.dataflair.mp3musicplayer;

/**

* @author NARENDER KESWANI

*/

import javazoom.jl.player.Player;

import javax.swing.*;

import javax.swing.filechooser.FileNameExtensionFilter;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.io.*;

public class MusicPlayer implements ActionListener {


//Creating Frame

JFrame frame;

//Creating Label for printing the selected song name

JLabel songName;

//Creating button for selecting a song

JButton select;

//Creating Panels

JPanel playerPanel, controlPanel;

//Creating icons for buttons

Icon iconPlay, iconPause, iconResume, iconStop;

//Creating buttons

JButton play, pause, resume, stop;

//Creating FileChooser for choosing the music mp3 file

JFileChooser fileChooser;

FileInputStream fileInputStream;

BufferedInputStream bufferedInputStream;

File myFile = null;


String filename, filePath;

long totalLength, pauseLength;

Player player;

Thread playThread, resumeThread;

public MusicPlayer() {

//Calling initUI() method to initiliaze UI

initUI();

//Calling addActionEvents() methods to add actions

addActionEvents();

//Calling Threads

playThread = new Thread(runnablePlay);

resumeThread = new Thread(runnableResume);

public void initUI() {

//Setting songName Label to center

songName = new JLabel("", SwingConstants.CENTER);

//Creating button for selecting a song

select = new JButton("Select Mp3");


//Creating Panels

playerPanel = new JPanel(); //Music Selection Panel

controlPanel = new JPanel(); //Control Selection Panel

//Creating icons for buttons

iconPlay = new ImageIcon("C:\\Users\\NARENDER KESWANI\\Downloads\\play-button.png");

iconPause = new ImageIcon("C:\\Users\\NARENDER KESWANI\\Downloads\\pause-button.png");

iconResume = new ImageIcon("C:\\Users\\NARENDER KESWANI\\Downloads\\resume-button.png");

iconStop = new ImageIcon("C:\\Users\\NARENDER KESWANI\\Downloads\\stop-button.png");

//Creating image buttons

play = new JButton(iconPlay);

pause = new JButton(iconPause);

resume = new JButton(iconResume);

stop = new JButton(iconStop);

//Setting Layout of PlayerPanel

playerPanel.setLayout(new GridLayout(2, 1));

//Addings components in PlayerPanel

playerPanel.add(select);

playerPanel.add(songName);
//Setting Layout of ControlPanel

controlPanel.setLayout(new GridLayout(1, 4));

//Addings components in ControlPanel

controlPanel.add(play);

controlPanel.add(pause);

controlPanel.add(resume);

controlPanel.add(stop);

//Setting buttons background color

play.setBackground(Color.WHITE);

pause.setBackground(Color.WHITE);

resume.setBackground(Color.WHITE);

stop.setBackground(Color.WHITE);

//Initialing the frame

frame = new JFrame();

//Setting Frame's Title

frame.setTitle("DataFlair's Music Player");

//Adding panels in Frame

frame.add(playerPanel, BorderLayout.NORTH);

frame.add(controlPanel, BorderLayout.SOUTH);
//Setting Frame background color

frame.setBackground(Color.white);

frame.setSize(400, 200);

frame.setVisible(true);

frame.setResizable(false);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

public void addActionEvents() {

//registering action listener to buttons

select.addActionListener(this);

play.addActionListener(this);

pause.addActionListener(this);

resume.addActionListener(this);

stop.addActionListener(this);

@Override

public void actionPerformed(ActionEvent e) {

if (e.getSource().equals(select)) {

fileChooser = new JFileChooser();

fileChooser.setCurrentDirectory(new File("C:\\Users"));
fileChooser.setDialogTitle("Select Mp3");

fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);

fileChooser.setFileFilter(new FileNameExtensionFilter("Mp3 files", "mp3"));

if (fileChooser.showOpenDialog(select) == JFileChooser.APPROVE_OPTION) {

myFile = fileChooser.getSelectedFile();

filename = fileChooser.getSelectedFile().getName();

filePath = fileChooser.getSelectedFile().getPath();

songName.setText("File Selected : " + filename);

if (e.getSource().equals(play)) {

//starting play thread

if (filename != null) {

playThread.start();

songName.setText("Now playing : " + filename);

} else {

songName.setText("No File was selected!");

if (e.getSource().equals(pause)) {

//code for pause button

if (player != null && filename != null) {

try {

pauseLength = fileInputStream.available();
player.close();

} catch (IOException e1) {

e1.printStackTrace();

if (e.getSource().equals(resume)) {

//starting resume thread

if (filename != null) {

resumeThread.start();

} else {

songName.setText("No File was selected!");

if (e.getSource().equals(stop)) {

//code for stop button

if (player != null) {

player.close();

songName.setText("");

}
}

Runnable runnablePlay = new Runnable() {

@Override

public void run() {

try {

//code for play button

fileInputStream = new FileInputStream(myFile);

bufferedInputStream = new BufferedInputStream(fileInputStream);

player = new Player(bufferedInputStream);

totalLength = fileInputStream.available();

player.play();//starting music

} catch (Exception e) {

e.printStackTrace();

};

Runnable runnableResume = new Runnable() {

@Override

public void run() {

try {

//code for resume button

fileInputStream = new FileInputStream(myFile);


bufferedInputStream = new BufferedInputStream(fileInputStream);

player = new Player(bufferedInputStream);

fileInputStream.skip(totalLength - pauseLength);

player.play();

} catch (Exception e) {

e.printStackTrace();

};

public static void main(String[] args) {

MusicPlayer mp = new MusicPlayer();

}
Output
BIBILIOGRAPHY

REFERENCE BOOKS:

1] Edward angel: Interactive computer graphics A TOP-DOWN


Approach with OpenGL, 2nd edition, Addison-Wesley, 2000.

[2] F.S. Hill, Jr.: computer graphics using OpenGL, 2nd edition, Pearson education,
2001.

WEB URL’S:

Http://msdn.microsoft.com http://codeproject.com
http://stackoverflow.com
Weekly Work / Progress Report –

Details of 16 Engagement Hours of the Student Regarding


Completion of the Project
Sign of
Timing Work or activity Performed the
Week Guide
Date
No. Duration
From To in min.

Discussion and Finalization of the


1 16/10/22 3.00 pm 4.00 pm 15 min
Project Title
Preparation and Submission of
2 17/10/22 4.00 pm 4.30 pm 30 min
Abstracts

3 18/10/22 3.00 pm 4.00 pm 20 min Literature Review

4 14/11/22 4.00 pm 6.00 pm 3 hour Collection of Data

6 15/11/22 3.00 pm 3.30 pm 30 min Discussion and Outline of Content

Rough Writing of the Projects


7 16/11/22 4.00 pm 3.30 pm 30 min
Contents
Editing and Proof Reading of the
8 6/12/22 3.00 pm 4.00 pm 1 hour
Contents

9 7/12/22 3.00 pm 4.00 pm 1 hour Final Completion of the Project

Assessment and Submission of


10 30/12/22 3.00 pm 4.00 pm 45 min
Report
NANEXURE-II

Evaluation Sheet for the Micro Project (Teachers Copy)

Academic
Name of Guider: Mr. M. P. Vasave
Year:-2022-2023
Sem :- Fifth Program Name : Advance Java
Course Name: : Course Code: 22517
Environmental Studies

Name of Students:- 1) Sanika. S .Deore


2) Unnati .S. Surywanshi
3 Tejaskumar .D.Girnar
4) Devam.N.Shroff
Title of the Project:- Music Player System
➢ COs addressed by the MicroProject:

(A)
MajorLearningOutcomesachievedbystudentsbydoingtheProject:
(B) (a) PracticalOutcomes:
(b) Using
(c) Outcomes (in Cognitive domain)
(d) Outcomes in AffectiveDom
(e) Comment/Suggestions about teamwork/leadership/interpersonal
Communication
(f)
+ All the team members were co-operative and helped each other. The team members
gave full support. Rather, there was no mis-understanding among any of any of the team
members.

Name of student Total marks Total marks Total Remarks


Out of Out of marks

Sanika Deore

Unnati Surywanshi

Tejaskumar Girnar

Devam Shroff

You might also like