You Are Here:

Community: Developer Discussion Boards

#1 Old MediaException when loading MP3 - 2008-03-02, 17:00

Join Date: Feb 2008
Posts: 12
cjohnstone
Offline
Registered User
I'm trying to import a .mp3 file but I'm hitting a MediaException. I'm using:

InputStream audioSource = getClass().getResourceAsStream(fileLocation);
Player audio = Manager.createPlayer(audioSource,"audio/mp3");

Can anyone spot any faults / things I should be doing different? The file definitely exists and is definitely an MP3 file.
Reply With Quote

#2 Old Re: MediaException when loading MP3 - 2008-03-02, 22:29

Join Date: Feb 2008
Posts: 12
cjohnstone
Offline
Registered User
Okay, I can get it to load and play using a WAV file. Any suggestions on how to get it working with an MP3?
Reply With Quote

#3 Old Re: MediaException when loading MP3 - 2008-03-03, 03:48

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
As the API docs says, MediaException will be thrown if a Player cannot be created for the given stream and type. Which phone are you using ?

Give a try with the mime type "audio/mpeg" ?

Also have a look at MIDP: Mobile Media API Support In Nokia Devices v2.0

MIDP: Mobile Media API Developer's Guide v2.1

Regards
Gopal
Reply With Quote

#4 Old Re: MediaException when loading MP3 - 2008-03-03, 08:29

Join Date: Apr 2007
Posts: 220
amitmishra19
Offline
Regular Contributor
Hi,

may i know which phone your are trying and what exactly is the exception message.

as you mentioned, if you can run the WAV file then its sure that there is no issue as far as the file reading and player creation logic is concerned.

the possible ghosts may be the mime type or your phone's media support!

Regards
Reply With Quote

#5 Old Re: MediaException when loading MP3 - 2008-03-03, 10:32

Join Date: Feb 2008
Posts: 12
cjohnstone
Offline
Registered User
It's the Java Wireless toolkit emulator.

I will try changing the type to MPEG, shortly.
Reply With Quote

#6 Old Re: MediaException when loading MP3 - 2008-03-04, 01:27

Join Date: Feb 2008
Posts: 12
cjohnstone
Offline
Registered User
No success with mpeg on the J2ME WTK emulator. WAV is all that will seem to work.

I can't get the Nokia emulator to run (JAR file could not be initialized), so I have no way to test it with that.
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
Theme Studio 3.1 not creating themes zemm Themes/Carbide.ui 11 2008-10-18 09:41
Compilation series 60 3rd edition asmobease Symbian Tools & SDKs 32 2006-09-13 10:46
Compilation series 60 3rd edition asmobease General Symbian C++ 3 2006-09-10 15:08

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