Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Jaco Mp3 Player

Posted on 2014-01-25
8
Medium Priority
?
1,099 Views
Last Modified: 2014-02-04
I'm am trying to use the jaco mp3 player library to play mp3 files.

Please reference site: Jaco Examples
Examples 1 -6 play the sound for second but Example7 plays the all my files.

Can you somebody help me figure this out? I am a complete newbie when it comes to programming and I am trying to learn.

I would like to use the player or windows media player to play url mp3 files from a website.

import jaco.mp3.player.MP3Player;

import java.io.File;

public class Example1 {

  public static void main(String[] args) {
    new MP3Player(new File("test.mp3")).play();
  }

}

Open in new window


The above code played sound for a second on my system.

import jaco.mp3.player.MP3Player;
import jaco.mp3.player.plaf.MP3PlayerUICompact;

import java.io.File;
import java.net.URL;

import javax.swing.BorderFactory;
import javax.swing.JFrame;

public class Example7 {

  public static void main(String[] args) throws Exception {

    // MP3Player.setDefaultUI(MP3PlayerUICompact.class);

    //

    MP3Player player = new MP3Player();

    player.setRepeat(true);

    player.addToPlayList(new File("test.mp3"));
    player.addToPlayList(new File("test2.mp3"));
    player.addToPlayList(new File("test3.mp3"));
    player.addToPlayList(new URL("http://server.com/mp3s/test4.mp3"));

    //

    player.setBorder(BorderFactory.createEmptyBorder(50, 100, 50, 100));

    JFrame frame = new JFrame("MP3 Player");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(player);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
  }

}

Open in new window


The above code works fine on my pc.
0
Comment
Question by:DOCDGA
  • 4
  • 4
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 39809964
Where are all the test mp3 files from?
0
 

Author Comment

by:DOCDGA
ID: 39810829
CEHJ, I'm not sure. I used my personal mp3 files.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39811396
Please attach test.mp3
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:DOCDGA
ID: 39812143
I can not attach the mp3 file because it is not an acceptable file to upload. This is the message that I receive from the upload tool.

Try this link:
mp3 file

If link does not work, copy and paste into browser: http://sourceforge.net/p/jacomp3player/code/HEAD/tree/JACo%20MP3%20Player%20v3/resources/bosco.mp3
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39812607
I have the same result. You should ask the author(s)
0
 

Accepted Solution

by:
DOCDGA earned 0 total points
ID: 39813058
CEHJ, I found this during a google search.

https://sites.google.com/site/teachmemrxymon/java/how-to-use-mp3player-class

I'm not sure if this could help me but thought you may wanna look at it.

I don't no to much about threads except they allow you to multitask.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39821085
I tried it on a separate thread. Made no difference for me (silence)
0
 

Author Closing Comment

by:DOCDGA
ID: 39831977
Received some insight from another programmer that the code I found from Mr Xymon allows the music player to operate on its own thread. This makes things easier.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Introduction to Processes
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question