You Are Here:

Community: Developer Discussion Boards

#1 Old Urgent Help Required in Player Class ( MMAPI ) - 2009-03-19, 18:21

Join Date: Mar 2009
Posts: 5
ccsCoder
Offline
Registered User
I am trying to play a MP3 file using the Java MMAPI. I am using the following code...

FileConnection fc = (FileConnection)Connector.open(filename);
InputStream is = fc.openInputStream();
Player p = Manager.createPlayer(is,"audio/mpeg");

Now, the problem is that, there is no sound output. I have attached a PlayerListener to the player. When i track the events, it shows that after realizing and prefetching, start, events, suddenly the EndOfMedia event occurs.

What could possible go wrong? Please help me, i am at my wits' end
Thanks...
Reply With Quote

#2 Old Thumbs up Re: Urgent Help Required in Player Class ( MMAPI ) - 2009-03-19, 18:34

Join Date: Sep 2008
Posts: 1,195
Location: DELHI
Send a message via Yahoo to jitu_goldie
jitu_goldie's Avatar
jitu_goldie
Offline
Forum Nokia Champion
Quote:
Originally Posted by ccsCoder View Post
I am trying to play a MP3 file using the Java MMAPI. I am using the following code...

FileConnection fc = (FileConnection)Connector.open(filename);
InputStream is = fc.openInputStream();
Player p = Manager.createPlayer(is,"audio/mpeg");

Now, the problem is that, there is no sound output. I have attached a PlayerListener to the player. When i track the events, it shows that after realizing and prefetching, start, events, suddenly the EndOfMedia event occurs.

What could possible go wrong? Please help me, i am at my wits' end
Thanks...
First of all u r not creating the fileconnection ie fc.create. open the connection in read mode like open(filename,Connector.READ). Also check out the filename given contains right path of that file u want to play. Check the extension of file u want to play and give the same format at createPlayer(). Also take care of the mode of device ie whether ur mobile is on silent mode or not. If ur device is on silent mode then u cant hear the sound of playing file.

please recheck ur code with making sure the correctness of the points discuss above.
if ur problem is not solved yet then pls post ur code at the forum so we can help u.

thanks,
jitu_goldie..


thanks,
jitu_goldie..

KEEP TRYING..
Reply With Quote

#3 Old Re: Urgent Help Required in Player Class ( MMAPI ) - 2009-03-20, 10:23

Join Date: Mar 2009
Posts: 5
ccsCoder
Offline
Registered User
I checked all that... ( Connector.READ ) and i have not yet deployed the app on a real device. I am using the WTK emulator to run the app. Now, it is accessing the file correctly, i have checked, starting playback but somehow it stops as soon as it starts.

However, i noticed something else. I started the MMAPIDemo sample project, and in that project, i gave the URL of the file i wanted to play. But then, that application also threw an exception that the Content Type was not supported, or in some cases Just freezed.

Now i am beginning to wonder whether MMAPI supports MP3 playback or not? I am attaching some code... Please have a look and comment. Thanks...

try{
FileConnection fc = (FileConnection)Connector.open("file:///root1/Kaash.mp3",Connector.READ);
InputStream is = fc.openInputStream();
Player p = Manager.createPlayer(is,"audio/mpeg");
p.addPlayerListener(this);
p.realize();
VolumeControl vc=(VolumeControl)p.getControl("VolumeControl");
vc.setLevel(100);
vc.setMute(false);

p.prefetch();

System.out.println(p.getDuration());
p.start();
}catch(Exception e) {System.out.println("H"+e.getMessage());}
Reply With Quote

#4 Old Thumbs up Re: Urgent Help Required in Player Class ( MMAPI ) - 2009-03-20, 17:40

Join Date: Sep 2008
Posts: 1,195
Location: DELHI
Send a message via Yahoo to jitu_goldie
jitu_goldie's Avatar
jitu_goldie
Offline
Forum Nokia Champion
hi,
have u got any exception.also please try it on real device. The code seems quite ok. prefetch the player before realizing it. pls mention the exception if any..


thanks,

jitu_goldie..


thanks,
jitu_goldie..

KEEP TRYING..
Reply With Quote

#5 Old Re: Urgent Help Required in Player Class ( MMAPI ) - 2009-03-20, 18:12

Join Date: Mar 2009
Posts: 5
ccsCoder
Offline
Registered User
Thanks, i am not getting any exception at all. But i'll test on real device and let you know...
Reply With Quote

#6 Old Thumbs up Re: Urgent Help Required in Player Class ( MMAPI ) - 2009-03-21, 12:22

Join Date: Sep 2008
Posts: 1,195
Location: DELHI
Send a message via Yahoo to jitu_goldie
jitu_goldie's Avatar
jitu_goldie
Offline
Forum Nokia Champion
Hi,
Pls take care of the format of file during creation of player. It should be same as that of file u wanna play. Also take care of the format supported by device.

thanks,
jitu_goldie..


thanks,
jitu_goldie..

KEEP TRYING..
Reply With Quote

#7 Old Re: Urgent Help Required in Player Class ( MMAPI ) - 2009-03-23, 04:31

Join Date: May 2007
Posts: 347
Location: Mexico D.F
rdrincon's Avatar
rdrincon
Offline
Forum Nokia Expert
It's not MMAPI not supporting mp3 files.
Its something related to the emulator or handset. It might be that WTK does not support this format.

You can check this retrieving the available audio encondings for the device/emulator

Code:
System.getProperty("audio.encodings")


:Ruben
Reply With Quote

#8 Old Thumbs up Re: Urgent Help Required in Player Class ( MMAPI ) - 2009-03-23, 10:18

Join Date: Sep 2008
Posts: 1,195
Location: DELHI
Send a message via Yahoo to jitu_goldie
jitu_goldie's Avatar
jitu_goldie
Offline
Forum Nokia Champion
Hi,
Its quite better to check formats supported by emaulator and real device too.

Quote:
Originally Posted by rdrincon View Post
It's not MMAPI not supporting mp3 files.
Its something related to the emulator or handset. It might be that WTK does not support this format.

You can check this retrieving the available audio encondings for the device/emulator

Code:
System.getProperty("audio.encodings")
thanks,
jitu_goldie..


thanks,
jitu_goldie..

KEEP TRYING..
Reply With Quote

#9 Old Re: Urgent Help Required in Player Class ( MMAPI ) - 2009-04-05, 00:13

Join Date: Apr 2009
Posts: 3
gauraviz_4u
Offline
Registered User
Basically WTK does not support mpeg format. If you really want to check your playing application(mpeg format) on emulator, then install Nokia SDK and run your application onto it. Its better to check your application on real devices only as sometimes emulator don't give exact result as compared to real devices.


Gaurav
Reply With Quote

#10 Old Re: Urgent Help Required in Player Class ( MMAPI ) - 2009-04-06, 08:56

Join Date: Jun 2007
Posts: 534
Location: Mumbai
Send a message via Yahoo to prakash.raman
prakash.raman's Avatar
prakash.raman
Offline
Super Contributor
Use nokia SDK, WTK one don't support MP3


au revoir
Prakash Raman
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
Why should Document hold engines/models and not AppUI? nawkboy General Symbian C++ 2 2007-03-14 18:15
Problem with Cabride.c++ v1.1 markovuksanovic Carbide.c++ IDE and plug-ins 3 2007-01-24 21:05
Exceptions while loading application avinash_rs Mobile Java General 0 2003-06-09 11:53
NOKIA, Sim ToolKit Class for Nokia 3410 URGENT RESPONSE REQUIRED!!!! HellBlade45 Mobile Java General 0 2003-05-03 12:29
class not found (urgent) !!! judas_x General Browsing 0 2003-02-12 07:46

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