You Are Here:

Community: Developer Discussion Boards

#1 Old Playing midi problem in 6280 - 2006-06-21, 04:04

Join Date: Jun 2006
Posts: 3
Orange123456
Offline
Registered User
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~
Reply With Quote

#2 Old Re: Playing midi problem in 6280 - 2006-06-21, 20:24

Join Date: Nov 2003
Posts: 3,641
Location: Bangalore , India
Send a message via Yahoo to balagopalks
balagopalks's Avatar
balagopalks
Offline
Forum Nokia Expert
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
Reply With Quote

#3 Old Re: Playing midi problem in 6280 - 2006-06-21, 20:25

Join Date: Mar 2006
Posts: 518
wang_shui
Offline
Super Contributor
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
Reply With Quote

#4 Old Re: Playing midi problem in 6280 - 2006-06-22, 09:01

Join Date: Jun 2006
Posts: 3
Orange123456
Offline
Registered User
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~
Reply With Quote

#5 Old Re: Playing midi problem in 6280 - 2006-06-27, 11:05

Join Date: Feb 2006
Posts: 689
soku123
Offline
Super Contributor
Hi friend,
Are you closing each player before starting the next player.If not it will throw the exception.
thanks
Soku
Reply With Quote

#6 Old Re: Playing midi problem in 6280 - 2006-06-28, 03:30

Join Date: Jun 2006
Posts: 3
Orange123456
Offline
Registered User
Do you mean that the sound has to be deallocate before prefetch next sound?
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ