×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    10

    Red face troubled with incoming call when playing sound

    i have problem if anyone can help me,
    2 i am using nokia 6230i
    3 i am playing sound/midi and in the middle of playing i have incoming call
    4 i release all the player resources using hideNotify()
    5 i receive the incoming call then after finish
    6 i select option->startplay to initialize and play again the midi/sound and i got "device error" exception until i quit my app and open it back.

    notes:
    i got no problem if i don't receive the incoming phonecalls. only if i received the phone call this error occured.

    here are my codes :

    Player mp;

    private void playmusic(String filename) throws MediaException, IOException {
    mp = Manager.createPlayer("file:///" + filename);
    mp.start();
    }

    public void hideNotify() {
    if (mp != null) {
    try {mp.stop();}
    catch (MediaException ex) {}
    mp.deallocate();
    mp = null;
    }
    System.gc();
    }

    PLEASEEEEEEEE..... HHHEELLLLLPPPPP :-((((
    Thank you sooooo muchhh... :-*

    warm regrads,
    -xins

  2. #2
    Registered User
    Join Date
    Jan 2006
    Posts
    1

    Re: troubled with incoming call when playing sound

    HI
    Same thing happens with me I am porting one of my game on 6230i & 6230, when we give call interrupt in game if we accept the call & after call ended resume the game all the in game sound will stop. If I am not accepting the call then everything is working fine. Can anybody has the solution then pls reply



    Regards
    Raju

  3. #3
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: troubled with incoming call when playing sound

    Hi xins,

    It was not clear on your post, i assume you're using Canvas and hideNotify(), obviously, but what about showNotify()?

    "device error" exception"
    Is there any further information about this error you could provide us?

    Also, worth noting is that Game User Experience Library by this same FN has good tips about pauses in Games (single-player and Multi-player). See an excerpt below:

    "An application should not change focus from one screen to another within the hideNotify() method (for example, Display.setCurrent(Displayable d)). In the Series 60 Platform, this causes focus to be regained by the game application. From the user’s point of view, it looks like pressing the End key or the Application key leads to the menu, which is not a desirable effect. It is recommended to use the Shownotify() method for regaining focus when changing display."

    Juarez Jr

  4. #4
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: troubled with incoming call when playing sound

    Hi kshirsagar,

    While u r accepting a call, if u r using any players u should stop them. otherwise it will automatically get stopped. this is because for the phone the incoming call has more priority than the game. so it will stop all players and that resource will be used for the incoming call.

    Regards,
    wang_shui

  5. #5
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: troubled with incoming call when playing sound

    hi,

    also try solution for restarting playback simply callin a method like that one:
    Code:
    void doPlay()
        {
     ...
             if (!initDone || player==null){
               initPlayer();
            }
            int state = player.getState();
            if (state == Player.CLOSED) {
            player.prefetch();
            } 
             else if (state == Player.UNREALIZED) {
            player.realize();
            
            } 
             else if (state == Player.REALIZED) {
            player.prefetch();
            }
            
            player.start();
     ...
    }
    called when form gains focus (showNotify()),
    (taken from Nokia Java Developers Library),
    regards,
    Peter

Posting Permissions

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