| Reply | « Previous Thread | Next Thread » |
|
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. |
| cjohnstone |
| View Public Profile |
| Find all posts by cjohnstone |
|
Okay, I can get it to load and play using a WAV file. Any suggestions on how to get it working with an MP3?
|
| cjohnstone |
| View Public Profile |
| Find all posts by cjohnstone |
|
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 |
|
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 |
| amitmishra19 |
| View Public Profile |
| Find all posts by amitmishra19 |
|
It's the Java Wireless toolkit emulator.
I will try changing the type to MPEG, shortly. |
| cjohnstone |
| View Public Profile |
| Find all posts by cjohnstone |
|
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. |
| cjohnstone |
| View Public Profile |
| Find all posts by cjohnstone |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| 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 |