×

Discussion Board

Results 1 to 5 of 5

Thread: Player

  1. #1
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    54

    The Player Class

    Hi guys,

    I have a very annoying problem:
    I'm trying to play streaming sound (mid) on my application.
    The thing is that this operation succeeds in some devices (N70), but fails in other (Nokia 6101).
    Here is the code I'm using:

    HttpConnection conn = (HttpConnection)Connector.
    open("my url", Connector.READ);
    InputStream is = conn.openInputStream();
    Player player = Manager.createPlayer(is,"audio/midi");

    player.realize();
    // get volume control for player and set volume to max
    VolumeControl vc = (VolumeControl) player.getControl("VolumeControl");
    if(vc != null)
    {
    vc.setLevel(60);
    }
    // the player can start with the smallest latency
    player.prefetch();
    // non-blocking start
    player.start();

    Please note that altough this fails in Nokia 6101, I'm still able to play sound (if I put a mid in my resources directory).

    Thanks in advance,
    Alonish
    Last edited by alonish; 2006-06-19 at 12:53.

  2. #2
    Regular Contributor
    Join Date
    Jan 2005
    Location
    France, Paris
    Posts
    56

    Re: Player

    Maybe it would be better if you use the Manager.createPlayer(String your_url) method instead of the one you use to create the player.
    Check also which content types the device handles for the "http" protocol, by using the Manager.getSupportedContentTypes method.

    Nicolas

  3. #3
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    54

    Re: Player

    Thanks for your reply.
    I already tried this, but it didn't work..... :-(

    Alonish

  4. #4
    Regular Contributor
    Join Date
    Jan 2005
    Location
    France, Paris
    Posts
    56

    Re: Player

    Hmm well :-/ Do you catch any exception?
    My guess would be that maybe it's just a gprs configuration problem. I used to have somes with other series 40 devices, like 6230, 6230i, 3220 and others... And it was a bit tricky... Even if your gprs profile is well configured (for the browser), maybe it is not, for your java application... Did you manage to make an http connection with your phone, for testing?

    Nicolas

  5. #5
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    54

    Re: Player

    Yep. The gprs connection works in other sections of my application.

    Alonish

Similar Threads

  1. Create 3GP player with J2ME for Mobile
    By dexxa05 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 57
    Last Post: 2012-01-10, 11:44
  2. Nokia N91 Real player
    By defade in forum General Development Questions
    Replies: 1
    Last Post: 2006-06-14, 16:34
  3. Chaining Player instances smoothly
    By jrosebor in forum Mobile Java General
    Replies: 3
    Last Post: 2005-10-18, 06:36
  4. Replies: 1
    Last Post: 2005-06-16, 12:15
  5. Video Player Midlet problem - please help
    By L_Tambiah in forum Mobile Java General
    Replies: 0
    Last Post: 2004-06-26, 15:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×