| Reply | « Previous Thread | Next Thread » |
|
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... |
|
Quote:
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.. |
| jitu_goldie |
| View Public Profile |
| Find all posts by jitu_goldie |
|
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());} |
|
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.. |
| jitu_goldie |
| View Public Profile |
| Find all posts by jitu_goldie |
|
Thanks, i am not getting any exception at all. But i'll test on real device and let you know...
|
|
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.. |
| jitu_goldie |
| View Public Profile |
| Find all posts by jitu_goldie |
|
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 |
|
Hi,
Its quite better to check formats supported by emaulator and real device too. Quote:
jitu_goldie.. thanks, jitu_goldie.. KEEP TRYING.. |
| jitu_goldie |
| View Public Profile |
| Find all posts by jitu_goldie |
|
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 |
| gauraviz_4u |
| View Public Profile |
| Find all posts by gauraviz_4u |
|
Use nokia SDK, WTK one don't support MP3
au revoir Prakash Raman |
| prakash.raman |
| View Public Profile |
| Find all posts by prakash.raman |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| 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 |