0% found this document useful (0 votes)
10 views

Java

Uploaded by

princerudra7978
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Java

Uploaded by

princerudra7978
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Music Player Using Java

A Subject Specific Project Report Submitted in partial fulfilment of the requirements of the Course on

JAVA (MC-T-PC-202) of

Master in Computer Application (MCA)


Submitted by

Balaram Gochhayat (2305298035)

Under the Guidance of


PROF. Pratyush Ranjan Mahapatra

DEPARTMENT OF MASTER IN COMPUTER APPLICATIONS

GANDHI INSTITUTE FOR TECHNOLOGY(GIFT) AUTONOMOUS, BHUBANESWAR


Affiliated To

BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA


CERTIFICATE

This is to certify that the mini-project entitled “MUSIC PLAYER SYSTEM” has
been carried out by Balaram Gochhayat(2305298035) and completed under
my guidance and the project meets the academic requirement of the subject
OOPS(MC-T-PC-202).

Signature of the guide


ACKNOWLEDGEMENT

I would like to express my deep sense of gratitude to my Faculty of JAVA,


Prof. Pratyush Ranjan Mahapatra for extending their support in compiling
this project.

I am also equally thankful to Prof. Satya Ranjan Pattnaik, HOD MCA, Dean
Academics and Principal for all the timely help and guidance, without whom
the completion of this project would not have been possible.

Last but not the least; I would be failing in my duty if I don’t mention the
names of the members of my family and friends for their ungrudging support
and encouragement in giving a facelift to this project.

Balaram Gochhayat (2305298035)


INTRODUCTION

Java is an object-oriented programming language developed by JamesGosling in


"sun microsystems" and it was released in 1995.
Java is a set of features of c and c++. It has obtained its format from c and features
from c++.
Java code that runs on one platorm does not need to be recompiled to run on
another platorm it's called write once, run anywhere (WORA).
Some Important features of java are given below:
1.Simple
2.Object-Oriented
3.Portable
4.Platorm independent
5.Secured
6.Robust
7.Architecture neutral
8.Interpreted
9.High Performance
10.Multthreaded
11.Distributed
12.Dynamic
About the project:

In this project, we create a java program play music stored on machine and control
it using various java components.

1.Develop programs to handle events in java programming.

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

Music Player lets you manage all your music files quickly and easily.This audio layer
supports almost all types of mp3 3, midi, wav, flac raw aac files and other audio
formats Easily browse and play music songs by genres, albums, artists, songs and
folder.Media is integral parts of our lives. We ane creating media player using java
to handle all the mic purements of user.
Program Code:-

package jlay;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedInputStream;
import java.io.File;

import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.Player;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.function.Function;

public class layer {


Player:
BufferedInputStream bis;
FileInputStream fis
File file;
Layer(){
JFrame main new JFrame();
main.setVisible(true);
main.setVisible(400,440);
main.setLayout(new FlowLayout());
main.setBackground(Color.MAGENTA);

JButton choose = new JButton("Choose Your Song");


choose.addActionListener
(
new ActionListener()
{
@Override
public void action Performed(ActionEvent actionEvent)
{
open dialog();
}
}
}
main.add(choose);
JButton play=new JButton("Play");
play.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
try
player.play(100);
}
catch (Exception x){}
}
});
main.add(play);
JButton pause new JButton("Pause");
pause.addActionListener(new ActionListener() {
Override @
public void actionPerformed(ActionEvent actionEvent) {
try
{
player.wait();
}
catch (Exception x){}
}
});
main.add(pause);
main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE),
}
void open dialog()
{
JFileChooser fe new JFileChooser();
int result fc showOpenDialog(null);
if (result ==JFileChooser APPROVE_OPTION)
{
try {
file=new Fileffc.getSelectedFile().getAbsolutePath());
fis= new FileInputStream(file),
bis= new BufferedInputStream(fis),
try{
player new javazoom.ji.player.Player(bis);
}
catch (Exception ec){}
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
public static void main(String[] args)
{
layer 1 new layer();
}
}
OUTPUT:

You might also like