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.

Reply With Quote

