×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    7

    Can I set the player to wait for 5 seconds before playing song?

    Hi,

    Can I set the player to wait for 5 seconds before playing the song in the second time?

    private void addAudio(){
    try {
    player = Manager.createPlayer(in, "audio/x-wav");
    player.setLoopCount(3);
    player.realize();
    player.prefetch();
    player.start();
    }
    catch (Exception e) {
    }
    }

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Can I set the player to wait for 5 seconds before playing song?

    Would Thread.sleep() solve your problem?

    Hartti

  3. #3
    Registered User
    Join Date
    Nov 2011
    Location
    ahmedabad
    Posts
    32

    Re: Can I set the player to wait for 5 seconds before playing song?

    Thread.sleep() is working on the emulator.. But in device NOKIA C2.. NOT WORKING

    I have tried and implement.

    Any other way ?

    Thanks
    Jigar

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Can I set the player to wait for 5 seconds before playing song?

    Jigar, you need to provide more details. What are you trying to do? What happens? (Not working is not descriptive enough). Also share relevant parts of the code (NOT the whole code base).

    Hartti

  5. #5
    Registered User
    Join Date
    Nov 2011
    Location
    ahmedabad
    Posts
    32

    Re: Can I set the player to wait for 5 seconds before playing song?

    Hii Hartti,

    My requirement is as below :

    I am running the application first time it will ask a user to select a file from memory card. So will be navigating to the file which i want to play. i am saving all the path for this particular directory. After that i m invoking the player manager in creating the player which has source of that particular memory card song file.

    Now in PLAYER UPDATE of player listener part i am taking end of media as a comparison for the status of the song which is playing. and after that i am running Thread.sleep for setting value 5 secs. In the emulator it is showing and running perfect. but when i am installing the same in the phone it is not getting this interval.

    PLAY SONG -------- 5 sec INTERVAL ------------ PLAY SONG -------- 5 sec INTERVAL ------------ PLAY SONG -------- 5 sec INTERVAL ------------ PLAY SONG and so on.

    This is what i want to do.
    Last edited by rathodjigar; 2012-03-26 at 15:29.

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Can I set the player to wait for 5 seconds before playing song?

    Welcome to the Nokia Developer Boards !!!

    Another trick could be to give a pause inside the updatePlayer() method instead inside the life cycle of the player. Test this if works.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Nov 2011
    Location
    ahmedabad
    Posts
    32

    Re: Can I set the player to wait for 5 seconds before playing song?

    Hi All,

    Problem solved. Have put thread wait for 5 sec.

    Thanks all..


Similar Threads

  1. how can I play the song repeatly and stop playing the song?
    By vinnahang in forum Mobile Java General
    Replies: 5
    Last Post: 2012-03-23, 13:23
  2. multimedia player for 6630 that features fast fordard in playing movies
    By lenjohnhotmail in forum Mobile Java General
    Replies: 0
    Last Post: 2006-02-02, 08:59
  3. MMAPi player finished playing
    By erviins in forum Mobile Java General
    Replies: 1
    Last Post: 2005-11-28, 16:29
  4. Player does not support playing back other format-audio than default format?
    By williampresent in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-08-09, 09:14
  5. Replies: 1
    Last Post: 2005-06-16, 12:15

Posting Permissions

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