Help Playing MP3 files in a java application!

I can't get Mp3s to play in a JFrame. Any help is apperciated thx.
Message was edited by:
h@LL

Google for JLayer.

Similar Messages

  • Help Playing a MP3 files in a java application!

    Hey, i need help playing MP3 files in a JFrame application. Any help is apperciated.

    Google for JLayer.

  • [Help]Playing MP3 files with Juk have to wait for 1 hr to hear voice

    I am not sure how long should wait, but difinately longer than 10min. If you are playing a playlist, you have to wait a long time for next song...
    Observations:
    1. You can hear voice after all, that means the hardware and codec is working properly.
    2. You can play the mp3 file with smplayer without difficulty. that means the filesystem/storage hardware should'nt be problematic.
    3. When waiting for playing songs, the CPU usage of Juk is remaining on about 3%. I believe it is a reasonable value and does not indicating any problem of the program.
    Have anybody here got this problem before? Help!

    in case your phonon backend is gstreamer, change it to xine. that's what is recommended by amarok devs.

  • Safari no longer plays mp3 files (OS X 10.9.5 Safari 7.1). Help!

    I have a 6-month-old MacBook Pro (13" Classic) running OS X 10.9.5. I use Safari 99% of the time to browse the web (version 7.1). Quicktime Player 10.3.
    All of a sudden (this week), Safari has stopped playing mp3 files. I have always been able to click on a link to an mp3 file and it would play in the browser. Now, this has stopped working. It does open a black page with the audio scroll bar showing. However, the arrow will not respond if I click it and it just says "Loading..." forever.
    What's up?!

    Force quit Safari and relaunch it while holding down the shift key.

  • Simple GUI playing mp3 files

    Hi everyone , i am building a simple GUI playing mp3 files in a certain directory.
    A bug or something wrong with the codes listed down here is very confusing me and makes me desperate. Can anyone help me please ?
    import javax.swing.*;
    import javax.media.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    class PlayMP3Thread
    extends Thread
    private URL url;
    String[] filenames ;
    File[] files ;
    boolean condition=true;
    boolean pause=false;
    int count ;
    public PlayMP3Thread() { }
    public PlayMP3Thread(File[] files)
    //try
              this.files = files;
         filenames = new String[files.length];
         count = -1;
         // this.url = mp3.toURL();
         //catch ( MalformedURLException me )
    public void run()
    try
         while (condition)
              count++;
              if (count > (filenames.length - 1)) {
                        count = 0;
              this.url = files[count].toURL();
    MediaLocator ml = new MediaLocator(url);
    final Player player = Manager.createPlayer(ml);
    /*player.addControllerListener(
    new ControllerListener()
    public void controllerUpdate(ControllerEvent event)
    if (event instanceof EndOfMediaEvent)
    player.stop();
    player.close();
    player.realize();
    player.start();
    catch (Exception e)
    e.printStackTrace();
    public void stops()
    //stop the thread
    condition=false;
    pause=false;
    public void pause()
    while(!pause)
    //pause the thread
    try
    wait();
    catch(Exception ex){}
    pause=true;
    public void resumes()
    while(pause)
    notify();
    pause=false;
    } // end of class MP3Thread
    public class mp3Play extends JFrame {
    JTextField direcText ;
    JFileChooser fc;
    static final String
    TITLE="MP3 PLAYER",
    DIRECTORY="Directory : ",
    BROWSE="Browse...",
    START="Start up",
    STOP="Stop",
    PAUSE="Pause",
    RESUME="Resume",
    EXIT="Exit";
    public static void main(String args[])
         PlayMP3Thread play = new PlayMP3Thread();
         mp3Play pl = new mp3Play();
    } // End of main()
    public mp3Play() {
    setTitle(TITLE);
         Container back = getContentPane();
         back.setLayout(new GridLayout(0,1));
         back.add(new JLabel(new ImageIcon("images/hello.gif")));
         fc = new JFileChooser();
         fc.setFileSelectionMode(fc.DIRECTORIES_ONLY);
         JPanel p1 = new JPanel();
         p1.add(new JLabel(DIRECTORY, new ImageIcon("images/directory.gif"), JLabel.CENTER));
    p1.add(direcText = new JTextField(20));
         JButton browseButton = new JButton(BROWSE, new ImageIcon("images/browse.gif"));
         browseButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    int returnVal = fc.showOpenDialog(mp3Play.this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
              direcText.setText(fc.getSelectedFile().toString());
              File[] files = (new File(direcText.getText())).listFiles(this);
         p1.add(browseButton);
         back.add(p1);
         JPanel p2 = new JPanel();
              JPanel butPanel = new JPanel();
              butPanel.setBorder(BorderFactory.createLineBorder(Color.black));
              JButton startButton = new JButton(START, new ImageIcon("images/start.gif"));
              startButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
                        PlayMP3Thread play = new PlayMP3Thread(files);
                        play.start();
         butPanel.add(startButton);
         p2.add(butPanel);
         JButton stopButton = new JButton(STOP, new ImageIcon("images/stop.gif"));
         stopButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
              play.stops();
         p2.add(stopButton);
         JButton pauseButton = new JButton(PAUSE, new ImageIcon("images/pause.gif"));
         pauseButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
              play.pause();
         p2.add(pausetButton);
         JButton resumeButton = new JButton(RESUME, new ImageIcon("images/resume.gif"));
              resumeButton.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
                   play.resumes();
         p2.add(resumeButton);
         back.add(p2);
    JButton exitButton = new JButton(EXIT, new ImageIcon("images/exit.gif"));
              exitButton.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
                   System.exit(0);
              p2.add(exitButton);
              back.add(p2);
              addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
         System.exit(0);
              pack();
         setVisible(true);
    }

    Actually I don't know much about fixing technical error or logical error.
    When it compiled , there are 6 errors showed up :
    can't resolve symbol : method listFiles (<anonymous java.awt.event.ActionListener>)
    location: class java.io.File
              File[] files = (new File(direcText.getText())).listFiles(this);
    can't resolve symbol: variable files
                        PlayMP3Thread play = new PlayMP3Thread(files);
    can't resolve symbol: variable play
              play.stops();
    can't resolve symbol: variable play
              play.pause();
    ^
    can't resolve symbol : variable pausetButton
    location: class mp3Play
         p2.add(pausetButton);
    ^
    can't resolve symbol: variable play
                   play.resumes();
    Any suggestions ?

  • SWF to play mp3 files located on the server

    Hello,
    Does anyone know if it is possible to create an SWF file that can play mp3 files directly from the server, without the need for a streaming media server or external JS.
    And also for the application to read the current directory its located in and build a playlist based on the files inside.
    any information of examples would be greatly appreciated.
    Peter.

    As for loading and playing the files there is no issue.  Simply load them as you would load any file.  You can even use a relative path if they are in the same folder as the SWF, or a sub-folder that is in the folder with the SWF.
    As for looking at the server directory for what files are there, and using them - I know of no way to do this.  That doesn't mean it is impossible, just that I haven't come across a method in my experience.
    What I typically do is to archive the list of files in an XML file, and load the XML.  I know, that adds an extra step, and an extra file, but it is the easiest method for approximating what you want to do.
    Let me edit this response.
    You could use javascript, or a server language to grab the list of files in the directory and pass it into Flash via the ExternalInterface classes.

  • ITunes takes a few seconds to start playing MP3 files

    I just started using this new MacBook Pro and transfered my music library to the new laptop. I'm having a problem with iTunes playing MP3 files: when I double click on a MP3 track iTunes seems to freeze for like 3 - 4 seconds before the track starts playing and then it plays normally without a hitch. This is happening with each and every MP3 track that I have in the library as well as new MP3 tracks that I'm adding. Th short delay/freeze also occurs when I try to view or alter the info of an MP3 track in the library, so that when I right click on a track and click Get Info, the 'Get Info' screen will take about 3 - 4 seconds to show up and the same freeze happens when I click OK to close the 'Get Info' screen.
    Note that this happens only with MP3 tracks. Tracks purchased from the iTunes store (AAC) do not have this problem and start playing without any delay/freeze.
    Another weird tidbit: When MP3 tracks are in the same playlist (or album) and I let them play one after another (without me skipping to the next/previous song) then the delay/freeze does not occur at all. This delay seems to just happen when I start playing a song or when I click the fast forward/Rewind buttons to skip to the next/previous track.
    Does anyone know what might be causing this? And if a fix is available somewhere? Thanks in advance!

    It only happens on mp3s not on AAC's to me too! Just so you all know. I thought an EXTERNAL DRIVE was my problem but after hours of research I found it's probably an intentional bug (just kidding Apple you don't hate other companies that much....geesh! ) It might not be this...but you never know.
    I thought maybe it was the TAG but it seems this has nothing to do with it. Point is either Apple left a bug on the last update of itunes MP3s because to them it's less of a priority or it's being messed up by Amazon folders (still looking in to), or maybe there was a problem with the install.
    So far my options are to get an MP3 to AAC convertor and dump my 3000 songs into a program for converting, wait for an update, reinstall, or keep looking for a missed solution.
    Any help would be appreciated!!
    [email protected]

  • Cannot play MP3 files in Dreamweaver CS4

    Hi
    Apogogies if this has been asked before.
    I have an embedded MP3 file on one of my DWCS4 pages but when I try to play it from the Properties Inspector I get the message "Unable to find the plugin that handles this media type".
    The sound file plays OK in Firefox and IE but I would like to be able to test it in DW. I have the currrent version of Apple QuickTime Pro installed.
    I am using both Windows XP and Vista with the same problem.
    Is there a plug I can download for DW only in order to play these files without resorting to converting the MP3 to another format.
    Any help would be much appreicated.
    Thanks
    George

    Yes but I did exactly what I accused you of doing so it was really bad!
    Software troubles can drive you a bit crazy. Sorry again.
    From: pziecina <[email protected]>
    Reply-To: <[email protected]>
    Date: Thu, 08 Oct 2009 09:16:11 -0600
    To: d maass <[email protected]>
    Subject: Cannot play MP3 files in Dreamweaver CS4
    Hi
    Thank you for the apology, but as we have all (probably), misread and
    therefore wrongly replied to posts, it is not really necessary.
    PZ

  • Creative MuVo N2000 doesn't play MP3 files anymore?! HE

    Hi everyone,
    I hope someone can help me out. Here's the problem.
    My MuVo N200 player doesn't play mp3 files anymore.. there's only a strange noise comming from the player if i attempt to play mp3's...he only plays the wma files?! I gave my player to my flatmate so she could here music on her vacation to the US, and that's when the problem started. I never had this problem before, and i wonder if she acidently pushed a buttom she shouldn't. I can't figure out how to fix it. Anyone has a clue what has happend, or if the player is "lost" :-( ?! PS: The player is brand new.
    Help is appriciated
    Thx Lizzy ;-)Message Edited by lizzard on 08-23-2005 03:45 AM

    Unfortunately, NONE of my friends use Windows anymore , even at work we use Linux for security reasons. So what am i supposed to do now... They have a link at Creative that makes you belei've that they support Linux and offer you the possibility to choose the operating system, in other words=Linux. When i told in a mail to Creative Norway that they offer Linux support at their download-site, they actualy had the nerve to tell me that they don't do that!! I told them to remove the choice if they don't offer it, and don't try to tell people that they are eighter blind or stupid, and i pasted the Link + added a Screenshot of the page into the mail!! I realy got upset. It is the last time i by something from Creative. My first player from Creative lasted exactly 2 weeks, after that he stopped working for one odd reason, so i paid a little more in order to get a better one in exchange, and that device didn't li've longer than month eighter?
    Not exactly QUALITY we are talking about..aren't we?
    What to do, what to do?
    Anyone has a clue?

  • Play mp3 file.

    Hello world.. :)
    I am creating a music syncing app, and i need to know how how to play a MP3 file, is it possible to do it on a different thread so you can start, and stop it at the press of a button, etc. I don't know one thing about threads...
    JavaNut13*

    If you want to play mp3 file, I think you should use JMF. Here is the link to download JMF 2.1.1e from SUN
    [http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/download.html|JMF 2.1.1e]
    You will need to install JMF first to manipulate the following code. You could get it from here:
    [http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/MDIApp.java|MDIApp.java]
    Eg: You could add mplayer.start(); mplayer.stop() in between the code; and with some 'if else' to create a loop button.

  • Media Player - can't play MP3 files

    I'm have trouble playing my MP3 files on Q10. (Car doesn't support Bluetooth music - only voice commands, hands free calling).
    My MP3 files are stored on micro 8gb card - when connecting USB cable phone tells me it "can't connect to my computer(?)"
    The USB connection DID work when I realised my 'Phone book was empty'. On voice commanding the settings to install Phone book (which it did) I am back to the 'unable to connect to computer ' message. Are these two events linked?
    What's going on?!
    My old Blackberry Torch with card only (No SIM - 'cos it's in my new phone) plays MP3 files fine - but I want my Q10 to play the files.
    Help?

    Thank you for your answer. My problem is with a direct link, [http://www.vocacionpasionista.com/Novedades/Un%20deseo%20de%20paz.mp3 this one] .
    The data URI seemed to work but just while it's loading, when the page loads the player disappears.
    The direct link doesn't work at all, just like with mine, that window pops up.

  • Why won't FireFox 4 play mp3 files that have been created since the FF update? It will play mp3 files created prior to the FF update. All of the mp3 files have been created in the same manner, as bounces from Logic Pro 9. Thank you.

    Why won't FireFox 4 play mp3 files that have been created since the FF update? It will play mp3 files created prior to the FF update. All of the mp3 files have been created in the same manner, as bounces from Logic Pro 9. Thank you.

    Hi David,
    Thank you for your detailed question. It sounds like the real issue is pdf files. Are there any antivirus/firewalls that might be blocking this specific file type? or are there any preferences in your control panel that might be blocking this?
    Do you have any stored preferences for PDF files in Firefox?
    *[[Applications panel - Set how Firefox handles different types of files]]

  • How to create a .exe file for a java application

    Hi, I want to create a .exe file for a java application I am developing so that I can schedule it to run at a particular time using Windows Scheduler on WinNT. Is there any way to accomplish this? Or is there any other way in which a Java application can be scheduled to run at a particular time on Windows everyday?

    Create a .bat file and run that. Just have, in the .bat file:
    java YourClassName Alternatively, you can use javaw YourClassName (without *.bat, just put it into Windows Scheduler like suggested above).
    using javaw won't pop up any window...

  • Netstream.play() mp3 file

    Hello.
    I am having troubles playing an mp3 stream, using
    Netstream.play()
    According to AS 3.0 livedocs in Adobe...
    quote:
    To play MP3 files, use mp3: before the stream name. To play
    the ID3 tags of MP3 files, use id3: before the stream name
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetStream.html)
    When I test playing a video stream (.flv), everything works
    fine.
    The error I get when I try to play an mp3 is:
    Failed to play (stream ID: 1) code:
    NetConnection.Call.BadVersion
    I tried every different type of combinations:
    stream.play("mp3:test.mp3"), (test), (test.mp3) and nothing works.
    However, only in "mp3:test" I get the Call.BadVersion error. On the
    other ones, simply it doesn't play nothing... It finds the file
    though... because I get some results in the event handlers that i
    don't get when I enter an invalid filename...
    My question is... What is "NetConnection.Call.BadVersion",
    and is it really possible to play an mp3 stream. Are there other
    methods?

    Hi,
    Just check this url .its good you will get some idea.
    http://labs.flexcoders.nl/samples/MP3Player/version003/srcview/index.html
    Thanks,
    Anand.G

  • [solved] I can't play MP3 files in JuK

    Hi
    When i try play a mp3 file, with juk, the system says this:
    [zuargo@zuargo-archlinux ~]$ juk
    [zuargo@zuargo-archlinux ~]$ xine is asking to seek behind the end of the data stream
    I have installed xine-phonon and it is uses default.
    I have tried installing gstreamer phonon (with all official of the repository plugins) but I have the same problem... I can't hear anything...
    I have tried installing pulseaudio but... nothing...
    I have tried installing oss but.... nothing
    I have tried erasing the file ~.xine/catalog.cache but... nothing...
    some web pages says solved it issue installing a package called libxine-ffmep but it is not in pacman...
    really I tried many options but I can't solved this problem
    of course, I can play mp3 files in the command line (throughout mpg123) and they sound good...
    sorry for my bad english I speak spanish
    Last edited by zuargo (2009-08-25 02:20:27)

    AdrenalineJunky wrote:
    from everything i'm reading, it seems like that error message is normally associated with xine-ffmpeg being missing...
    phonon-xine depends on xine-lib which depends on ffmpeg, but its probably worth checking to make sure they are installed.
    I have installed xine-lib
    Rasi wrote:Since there doesnt seem to be an obvious solution, simply use the gstreamer backend.
    I have used the gstreamer backend and it not works... I can't hear the mp3 files...
    another idea?

Maybe you are looking for

  • Calculation error in net value

    Hi friends, I have a scenario where we have only one pricing procedure defined which includes basic price,excise,ecess,hsecess,packing charges, discounts etc. One i have a sales order which has got basic price,jexp,jecs,j1ax and i add PDIS(packing di

  • Payment Advice with DME format

    Hi Experts, I have done a settings for DME format for Canada. It is generating properly, but while making payment run I am unable to get Remittance Payment advice using same settings. My abaper said that there is some print program needs to be attach

  • Automatic Material PR generation from Maintenance Plan/Order

    Dear All, I required some setting related with Automatic Material PR generation from Preventive Maintenance Plan/Order. Query:  how can i set the non stock material so that when my maintenance plan gets generated then system will automatically genera

  • DR-8 isn't doing much!

    I built my computer about two months ago complete with two 'nice' msi optical drives. The D16 handles all the straight reading tasks and seems to be working ok. The DR8-A is supposed to do all the burning...but it doesn't. I really need to do some fi

  • Where can i find the chassis file for import in MAX for drawing connection diagram before purchasing

    where can i find the chassis file for import in MAX for drawing connection diagram before purchasing chassis: NI PXIe-1078 thx