Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User cjohnstone's Avatar
    Join Date
    Feb 2008
    Posts
    12
    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.

  2. #2
    Registered User cjohnstone's Avatar
    Join Date
    Feb 2008
    Posts
    12
    Okay, I can get it to load and play using a WAV file. Any suggestions on how to get it working with an MP3?

  3. #3
    Nokia Developer Champion balagopalks's Avatar
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,427
    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

  4. #4
    Regular Contributor amitmishra19's Avatar
    Join Date
    Apr 2007
    Posts
    220
    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

  5. #5
    Registered User cjohnstone's Avatar
    Join Date
    Feb 2008
    Posts
    12
    It's the Java Wireless toolkit emulator.

    I will try changing the type to MPEG, shortly.

  6. #6
    Registered User cjohnstone's Avatar
    Join Date
    Feb 2008
    Posts
    12
    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.

Similar Threads

  1. Theme Studio 3.1 not creating themes
    By zemm in forum Themes/Carbide.ui
    Replies: 11
    Last Post: 2008-10-18, 08:41
  2. Compilation series 60 3rd edition
    By asmobease in forum Symbian Tools & SDKs
    Replies: 32
    Last Post: 2006-09-13, 09:46
  3. Compilation series 60 3rd edition
    By asmobease in forum Symbian C++
    Replies: 3
    Last Post: 2006-09-10, 14:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved