×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    2

    Question Crosplatform play sound series 40

    Hi,
    i want to create crossplatform class to play sound using MMAPI (MIDI and WAV) if it exist or use NOKIAUI (TONES and WAV).

    To check support MMAPI i use:
    try
    {
    Class.forName("com.nokia.mid.sound.Sound");
    platform = NOKIA_UI;
    System.out.println("UI");
    } catch (Exception e)
    {
    System.out.println(e.getMessage());
    }
    try
    {
    Class.forName("javax.microedition.media.Manager");
    Class.forName("javax.microedition.media.Player");
    platform = NOKIA_MMAPI;
    System.out.println("MMAPI");
    } catch (Exception e)
    {
    System.out.println(e.getMessage());
    }
    after that i load sound using this method:
    sounds[index] = javax.microedition.media.Manager.createPlayer(getClass().getResourceAsStream(PATH_SOUNDS + file), typeValue);
    and play:
    sounds[index] = javax.microedition.media.Manager.createPlayer(getClass().getResourceAsStream(PATH_SOUNDS + file), typeValue);

    Nokia Series 40 DP 1.0 (6610, 6100) trows exeption "Cannot create a class in system package".
    If somebody know other solution to fix this problem, please tell me ASAP.

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    87
    I guess you are importing a Nokia Midi package/class at the top of your code which will cause that error, the Class.forName("..") method you described should work fine.

    Good luck.

Posting Permissions

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