×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    26

    playing mp3 file using j2me?

    Hai,

    How can i play a mp3 file using j2me.Whether mp3 file can be played using emulators?.When i am playing using emulator i am getting an error player can't be created.please help.


    Regards,
    nithya

  2. #2
    Registered User
    Join Date
    Sep 2010
    Location
    India
    Posts
    61

    Re: playing mp3 file using j2me?

    using following code you can play mp3

    try
    {
    Player p = Manager.createPlayer("file:///e:/alert.mp3");
    p.start();
    p.deallocate();
    }
    catch (IOException ioe) {ioe.printStackTrace(); }
    catch (MediaException me) {me.printStackTrace(); }


    }

  3. #3
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: playing mp3 file using j2me?

    also have a look in the wiki, there are several examples there and it also mentions some of the problems you might encounter (like playing mp3 files which are bigger than 2 mb on a S40)...
    Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them.

  4. #4
    Registered User
    Join Date
    Aug 2010
    Posts
    17

    Re: playing mp3 file using j2me?

    hello nithyakrishnan

    The emulator cant play mp3 file, but the mp3 files can be played on real device.

  5. #5
    Registered User
    Join Date
    Sep 2010
    Posts
    3

    Re: playing mp3 file using j2me?

    i am getting error as,

    java.io.IOException : bad url

    at

    Player p = Manager.createPlayer("file:///e:/alert.mp3");

    p.start();
    p.deallocate();

    why this happen??
    can anyone tell me where should I put my mp3 or wav file? i mean in which folder i should keep it.??
    kindly reply as soon as possible......
    I have to submit my project .

  6. #6
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: playing mp3 file using j2me?

    Quote Originally Posted by dhrt View Post
    i am getting error as,

    java.io.IOException : bad url

    at

    Player p = Manager.createPlayer("file:///e:/alert.mp3");

    p.start();
    p.deallocate();

    why this happen??
    can anyone tell me where should I put my mp3 or wav file? i mean in which folder i should keep it.??
    kindly reply as soon as possible......
    I have to submit my project .
    Hi, dhrt

    Just check in this article where steps are given to play a sound, from both local and network resources.

    http://wiki.forum.nokia.com/index.ph...und_in_Java_ME

    Best regards,

  7. #7
    Registered User
    Join Date
    Sep 2010
    Posts
    3

    Re: playing mp3 file using j2me?

    hey...rahul...
    thanks a lot man.... It works..
    bt now there is one more problem I faced. Once I played one .wav file..thn I tried to play another file in the same project bt it doesnt play it.
    it gives now java.lang.IIlegalArgumentException ..
    wht should now i do??

Similar Threads

  1. playing mp3 file in net beans
    By abdien in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2009-06-11, 08:14
  2. Need help regarding playing Mp3 files in J2ME
    By atiqkamran in forum Mobile Java Media (Graphics & Sounds)
    Replies: 11
    Last Post: 2007-08-27, 19:44
  3. playing mp3 file of size 1mb
    By karanala in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2007-02-21, 11:03
  4. how to show progress in playing mp3 file ?
    By serverclient2004 in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-07-15, 03:42
  5. Noise while playing mp3 file
    By csymbian in forum General Development Questions
    Replies: 1
    Last Post: 2004-05-19, 10:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×