| Reply | « Previous Thread | Next Thread » |
|
Dear all,
I have problem to play more than 1 midi for Nokia 6280 midp2.0. (screen size 240x320). I'm using MMAPI to play midi but I only able to play the first created midi and no sound for other midi. The same code runs no problem with SE S700. Thanks~ |
| Orange123456 |
| View Public Profile |
| Find all posts by Orange123456 |
|
Hi Orange123456! Welcome to Nokia Discussion Boards!! :)
I have tried playing more than one midi in 6280(not at a time), and it worked fine. Could you please post your code so that we could try it out. Regards Gopal |
|
Hi,
Can u pleasepost a code snippet so that we can figure out what have gone wrong. Does it throw any exception while the second midi is played?? Is the second midi a valid file. Fo this Have u tried replacing the first midi by the second midi and playing it?? Wang |
|
Thanks for your reply~
my code is like this: String [] musicFiles = {"Intro.mid","GameOver.mid","Enter.mid"}; for (int i=0;i<musicFiles.length;i++){ try{ InputStream is = getClass().getResourceAsStream("/"+musicFiles[i]); p[i] = Manager.createPlayer(is, "audio/midi"); if(p[i]!=null){ p[i].realize(); p[i].prefetch(); p[i].setLoopCount(1); //loop for one time } } catch(Exception e){} if(p[i]!=null){ p[i].addPlayerListener(this); } } in play method: public void play(int i) { try{ if(p[i].getState()==Player.PREFETCHED || p[i].getState()==Player.REALIZED) { errr = "RUN " + i; // run this p[i].start(); errr1 = "RUN COMPLETE " + i;// test whether complete run } } catch(Exception e){ errr1 = "error : " + e.getMessage();} } In real phone 6280, I able to play intro.mid but could not run any other sound. I catch 2 type of message in real phone i) if I run other midi when the intro.mid is running, I get this meesage "javax.microedition.media.mediaexception: cannot prefetch while another audio player is playing" ii) if I stop the running midi and play another midi, then I get this "javax.microedition.media.mediaexception: another midi player is active" Thanks~ |
| Orange123456 |
| View Public Profile |
| Find all posts by Orange123456 |
|
Hi friend,
Are you closing each player before starting the next player.If not it will throw the exception. thanks Soku |
|
Do you mean that the sound has to be deallocate before prefetch next sound?
|
| Orange123456 |
| View Public Profile |
| Find all posts by Orange123456 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Play midi problem on NGage/QD/7610/3230 | happyer | Mobile Java Media (Graphics & Sounds) | 2 | 2006-01-23 10:12 |
| Nokia 5140 midi problem | morash | Mobile Java General | 0 | 2006-01-13 23:54 |
| j2me play MIDI Problem | brian_tsim | Mobile Java Media (Graphics & Sounds) | 1 | 2006-01-11 08:53 |
| Playing midi during phonecall | Sidath | General Symbian C++ | 0 | 2003-12-16 08:54 |
| MIDI not playing within a .jar file... | coldmail | Mobile Java Media (Graphics & Sounds) | 0 | 2003-11-13 18:51 |