Hi all,
i am trying to play a midi file, using an s60 emulator, and i get a
javax.microedition.media.MediaException: cannot create player.
bellow is the code i use.
replacing the midi by a wav, it works, so i don't understand.
i checked the supported content types, and midi is supported, and also resource is a protocol that suports midi.
the file is found, but the player cannot be created, which i don't understandCode:try{ //i tried this Player p = (Manager.createPlayer("resource:/Nintendo_Tetris_Intro_19371.mid")); //and this InputStream in = getClass().getResourceAsStream("/Nintendo_Tetris_Intro_19371.mid"); Player p = Manager.createPlayer(in, "audio/midi"); p.realize(); p.prefetch(); p.setLoopCount(1); p.setMediaTime(0); p.start(); }catch(Exception me){ me.printStackTrace(); me.getMessage(); }
Thanks for any help

Reply With Quote


