×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    4

    Smile how to play multiple audio files in j2me

    i m developing an application using S60 3rd edition FP1 SDK, which can play multiple audio files.i tried this code but problem is it takes delay after playing one file i.e to start the next one. can anyone tell me how to play these files (one after another) using MMAPI. plzzz..its urgent

    public class AudioPlayer implements javax.microedition.media.PlayerListener{

    Player player;
    int count=0;

    public void playMedia(){

    try{

    player = Manager.createPlayer(getClass().getResourceAsStream(audioFiles[count]),"audio/x-amr");
    player.addPlayerListener(this);
    player.start();

    }
    catch (Exception e) {
    return ;
    }
    }


    public void playerUpdate(Player p,String event,Object eventData) {

    if (event==PlayerListener.END_OF_MEDIA)
    {
    try{
    if(++count == audioFiles.length)
    p.stop();
    else {
    player = Manager.createPlayer(getClass().getResourceAsStream(audioFiles[count]]),"audio/x-amr" );
    player.addPlayerListener(this);
    player.start();
    }
    }
    catch (Exception e) {
    return;
    }
    }
    }

    }


  2. #2
    Registered User
    Join Date
    Apr 2010
    Posts
    4

    Re: how to play multiple audio files in j2me

    i was thinking about another option to reduce the delay, that is to merge the N number of files and create a new one...but i havn't tried this bcz didnt get any clue on how to merge files....any anyone has experienced this...plz help.

  3. #3
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: how to play multiple audio files in j2me

    Hello A.Saleh,

    and welcome to Forum Nokia Discussion Boards!

    Please try not to cross-post over same topic to multiple forums.

    You topic is clearly related to Java ME so please let's continue on the correct forum here:

    Mobile Java|Mobile Java Media (Graphics & Sounds)|how to play two or more audio files in J2me

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

Similar Threads

  1. Play audio files
    By pankaj gupta55 in forum Symbian
    Replies: 17
    Last Post: 2010-04-26, 09:30
  2. How to play multiple .wav files?
    By BenNg in forum Symbian
    Replies: 20
    Last Post: 2010-02-22, 15:17
  3. play multiple audio files simultaneously
    By ed_welch in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2008-08-04, 16:55
  4. Cannot play more than 3 audio files?
    By hyon in forum Symbian
    Replies: 3
    Last Post: 2008-02-18, 05:19
  5. play audio files
    By khalandar in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2007-03-07, 05:58

Posting Permissions

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