Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User gorlab's Avatar
    Join Date
    Sep 2007
    Posts
    4
    Hi all,

    I try to play an audio file from the micro SD card in Nokia 6131. The following code is what I used:

    try
    {
    FileConnection fileConnection = (FileConnection) Connector.open(path);
    InputStream inputStream = fileConnection.openInputStream();
    Player player = Manager.createPlayer(inputStream, mimeType);
    player.realize();
    String contentType = inputStream.getContentType();
    player.setLoopCount(1);
    player.start();
    }
    catch (Exception e)
    {
    ...
    }

    However, I always get "Device Error" exception during start(). I have verified that getContentType() returns correctly.

    I have also tried the MediaSampler midlet (original .jar as well as recompiled .jar), both give the same "Device Error" exception. What could be wrong? Any suggestion on the source code?

  2. #2
    Registered User gorlab's Avatar
    Join Date
    Sep 2007
    Posts
    4
    Hi all,

    More testing revealed that the exception happens when prefetch() is called. My modified code is as follows:

    try
    {
    FileConnection fileConnection = (FileConnection) Connector.open(path);
    InputStream inputStream = fileConnection.openInputStream();
    Player player = Manager.createPlayer(inputStream, mimeType);
    player.realize();
    String contentType = inputStream.getContentType();
    if (contentType.equals(mimeType) != true)
    {
    // error
    }
    player.prefetch();
    player.start();
    }
    catch (Exception e)
    {
    // error
    }

    I have no problem in playing .3gp videos in 6131 using similar code, but none of the audio file I tried (.amr, .mp3, .wav). Anyone has any clue to share?

  3. #3
    Registered User dmunsie's Avatar
    Join Date
    Oct 2007
    Posts
    24
    I'm getting the same error with one of our 6131s running v3.50 of the software. We have another one with v3.72 on it, and our application runs fine. This is the only difference between the phones that I've been able to find.

    Is this a known issue with v3.50? Or is there something else we should be looking at?

  4. #4
    Registered User dmunsie's Avatar
    Join Date
    Oct 2007
    Posts
    24
    I just did a check, and the v3.50 firmware does not report 'audio/mpeg' as one of it's supported content types. Instead it lists 'audio/mpeg3'. But, using 'audio/mpeg3' still yields a MediaException.

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. Help needed with a 3gp file...
    By joedoe_1981 in forum Streaming and Video
    Replies: 0
    Last Post: 2007-07-18, 18:58
  3. Replies: 3
    Last Post: 2006-12-04, 20:10
  4. cannot able to play a video file.
    By shalini.mishra in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2006-11-13, 16:54
  5. Is it possible to play video file per frame.
    By b4605318 in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-04-25, 17:03

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