You Are Here:

Community: Developer Discussion Boards

#1 Old MediaException: cannot create player (while trying to play a midi) - 2005-03-14, 12:40

Join Date: Mar 2005
Posts: 499
Location: Paris
njzk2
Offline
Regular Contributor
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.
Code:
    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();
	}
the file is found, but the player cannot be created, which i don't understand
Thanks for any help
Reply With Quote

#2 Old 2005-03-21, 11:34

Join Date: Mar 2005
Posts: 3
bj@mobilepeople.dk
Offline
Registered User
Be careful by using setMediaTime(0); This could also throw an exception.
/Brian
Reply With Quote

#3 Old 2005-03-21, 14:42

Join Date: Mar 2003
Posts: 258
Location: Moscow/Russia
Send a message via ICQ to henson2K
henson2K
Offline
Regular Contributor
Perhaps the name of your resource is too long for S60
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

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