problem with series60 DP2: getResourceAsStream

ive noticed that one game of mine has a strange problem on nokia phones type series60 DP2. the error also occurs on the according emulator.

after a while i found the problematic source:
[source]
InputStream is2 = getClass().getResourceAsStream(“intro.mid”);
mpIntro = Manager.createPlayer(is2, “audio/midi” );
mpIntro.realize();
mpIntro.prefetch();
[/source]

it seems that the stream isnt read properly (although working on all other phones).

and i dunno whhhyyyyy … ???

displayed error:

jes-0-java-mma
@70785f

the error occurs at initilization time, not at playing the midi

try to read the midi file and pass the byte array when u create the player

i tried all suggestions on inet and the famous “nokia know issues” white papers (where the common answer is: “Yes, we know it” and “no, theres no solution”).

my only goal was to get a midi file played on a 6600 DP2 handy (also on the according emulator).
but after many tries (also with commercial games which are distributed for the 6600!!), all get the same error.

so if theres anyone out there who has a midi-supported game and is able to run it on his 6600, please inform me !

ps: the midp2 tutorial from nokia (game: SheepDog) does not run on 6600 (although it it categorized there …)

This work for me …


Player player=Manager.createPlayer(new ByteArrayInputStream(midi),"audio/midi");
player.realize();
player.prefetch();

The Sheepdog game works on my 6600. What software version do you have? (In the normal phone screen, type “*#0000#”; my 6600 is V 4.09.1).

Sheepdog uses very short MIDI sounds for its game-over and high-score sounds. It uses the same code as you use. But: when using getResourceAsStream (or Image.createImage, which internally uses getResourceAsStream), it’s always best to make the filename absolute by starting it with a ‘/’. I.e., try replacing “intro.mid” with “/intro.mid” and see what happens. MIDP doesn’t actually specify what happens with non-absolute filenames.

David