×

Discussion Board

Results 1 to 7 of 7

Thread: 6230 mmapi

  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    2

    6230 mmapi

    hello

    i have got a problem with my game on 6230 phone. i have read http://discussion.forum.nokia.com/fo...ght=%2A6230%2A and a lot of docs, but i couldn`t resolve it. my game is using amr and midi files. code is:

    //initialization
    InputStream mysoundstream = getClass().getResourceAsStream("/sound/file.amr");
    mysound = Manager.createPlayer(mysoundstream, "audio/amr");
    mysound.setLoopCount(1);
    mysound.realize();
    mysound.prefetch();

    and it is called by a procedure

    void playToon(Player co)
    {
    if (co.getState() != Player.STARTED)
    {
    try { co.start(); }
    catch (IllegalArgumentException iae) { }
    catch (MediaException blad) { }
    }
    }

    in emulator everything works ok, but on a phone i get NullPointerException, and i don`t know why.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    25

    No AMR on 6230

    Hi !
    I nearly have the same problem with nokia 6230 and amr sounds. On the emulator all workes fine. But not on the real device !

    Have you solved your problem !?!?!

    best regards

    Joerg

  3. #3
    Registered User
    Join Date
    May 2005
    Posts
    2
    no i haven`t
    problem, that i have, refers not only to amr, but wav and midis also. i don`t try another formats.
    i have no other ideas to solve it :/

  4. #4
    Registered User
    Join Date
    Sep 2004
    Posts
    6
    Guys the Nokia 6230 phone doesn't support AMR or WAV playback. To see for yourself try out the following code, just place it in a keyPressed event:

    String[] strArray=Manager.getSupportedContentTypes(null);
    StringBuffer temp= new StringBuffer();
    for(int i=0;i<strArray.length;i++)
    temp.append(strArray[i]+", ");
    Alert alert=new Alert("","Supported types:\n"+ temp,null,AlertType.ERROR);
    Display.getDisplay(parent).setCurrent(alert);
    temp=null;strArray=null;

    On the Nokia 6230 phone I get:
    Supported types:
    audio/x-tone-seq, audio/midi, audio/sp-midi

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    6
    Originally posted by taux
    no i haven`t
    problem, that i have, refers not only to amr, but wav and midis also. i don`t try another formats.
    i have no other ideas to solve it :/
    The phone can play midi. Is there a problem with the code? This was my approach for a previous game I was working on (yes it works):

    try
    {
    InputStream in=getClass().getResourceAsStream("/res/combat1.mid");
    p = Manager.createPlayer(in,"audio/sp-midi");
    p.realize();
    // get volume control for player and set volume to max
    VolumeControl vc = (VolumeControl) p.getControl("VolumeControl");
    if(vc != null) {
    vc.setLevel(10);}
    p.setLoopCount(-1);
    p.prefetch();
    p.start();
    }
    catch(Exception e){e.printStackTrace();}

    Hope that helps.

  6. #6
    Registered User
    Join Date
    Aug 2005
    Posts
    29

    6230

    Tried this on a 6230 - froze the app. Why is sound so bad on this phone?

  7. #7
    Registered User
    Join Date
    Sep 2004
    Posts
    6

    Re: 6230 mmapi

    Hi Simon, are you talking about the code snippets I posted? Which one hangs your phone?

    P.S. I hate MMAPI support on Series40 nokias :P

Posting Permissions

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