Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User lucky7456969's Avatar
    Join Date
    Jul 2012
    Posts
    10
    Hi
    Code:
    public void load() 
    	{
    	     if(player != null) return;
    	     try {
    	          InputStream is = this.getClass().getResourceAsStream(file);
    	          player = Manager.createPlayer(is , "audio/mp3");
    	          player.prefetch();
    	          volumeControl = (VolumeControl) player.getControl("VolumeControl");
    	      } catch (IOException e) {
    	      } catch (MediaException e) {
    	      }
        }
    player is simply null on the project device
    Should I run it as Midlet, JAD, applet or application?
    Thanks
    Jack

  2. #2
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Based on the documentation, http://www.developer.nokia.com/Resou...a/Manager.html, I would try "audio/mpeg".

  3. #3
    Registered User lucky7456969's Avatar
    Join Date
    Jul 2012
    Posts
    10


    Which one should I choose?

    Code:
    public void load() 
    	{
    	     if(player != null) return;
    	     try {
    	          InputStream is = this.getClass().getResourceAsStream(file);
    	          player = Manager.createPlayer(is , "audio/mpeg");
    	          player.prefetch();
    	          volumeControl = (VolumeControl) player.getControl("VolumeControl");
    	      } catch (IOException e) {
    	      } catch (MediaException e) {
    	      }
        }
    Unfortunately, this still makes a null player. I believe that should work too. Strange.
    Thanks
    Jack
    Last edited by lucky7456969; 2012-09-17 at 09:23.

  4. #4
    Nokia Developer Expert bandarap's Avatar
    Join Date
    May 2012
    Posts
    222
    Emulated Java ME MIDlet is the correct one.

Similar Threads

  1. cannot create player
    By amalshah71 in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2010-12-23, 10:14
  2. Could Not Create Player
    By j2meSak in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2009-11-19, 09:27
  3. Unable to create player
    By hiteshrawat in forum Mobile Java General
    Replies: 15
    Last Post: 2009-06-16, 14:11
  4. Create Player
    By sureshA in forum Audio
    Replies: 3
    Last Post: 2008-09-27, 18:45
  5. Cannot create player..
    By bharatpatel85 in forum Mobile Java General
    Replies: 5
    Last Post: 2008-05-13, 17:09

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