×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    9

    How to play midi in the Series 60

    Did anyone use midi in the Series 60 phone like the 3650?
    I have a lot of problem when I try and use a midi file in the Series 60 phone.

    try
    {
    if(player==null)
    {
    InputStream is = getClass().getResourceAsStream("sound.mid");
    player = Manager.createPlayer(is,"audio/midi");
    player.setLoopCount(-1);
    }
    player.start();
    }
    catch (Exception e)
    {
    e.printStackTrace();
    }

    it give me the following error:
    java.lang.IllegalArgumentException
    at javax.microedition.media.Manager.createPlayer(+11)
    at GameScreen.<init>(+9291)
    at Rolling.<init>(+29)
    at java.lang.Class.runCustomCode(+0)
    at com.nokia.phone.sdk.concept.midp.jam.JARExplorer.open(+84)
    at com.nokia.phone.sdk.concept.midp.jam.Explorer.keyPressed(+132)
    at javax.microedition.lcdui.Display$DisplayAccessor.keyEvent(+219)
    at com.nokia.phone.sdk.concept.gateway.RemoteEventHandler$2.run(+198)

    Thank you
    Last edited by kwokt; 2003-06-10 at 19:58.

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    393
    Use a slash in the midi path - "/sound.mid"
    Assuming your midi in the jar is not in any folder.

    Also look at the MediaSampler example.

    Let me know if this helps.

    [N]/Forum Nokia

Posting Permissions

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