×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    4

    setMediaTime() Exception

    Hi,
    I need to jump an audio file (AMR-WB) at a specific time.
    Using setMediaTime() method i get the following exception:

    javax.microedition.media.MediaException: MUS
    at com.nokia.mid.impl.isa.mmedia.audio.AudioOutImpl.setProperty(AudioOutImpl.java:176)
    at com.nokia.mid.impl.isa.mmedia.MediaOut.setMediaTime(MediaOut.java:327)
    at com.nokia.mid.impl.isa.mmedia.MediaPlayer.doSetMediaTime(MediaPlayer.java:237)
    at com.nokia.mid.impl.isa.mmedia.BasicPlayer.setMediaTime(BasicPlayer.java:658)
    at frmReproducir.commandAction(frmReproducir.java:126)
    at javax.microedition.lcdui.Display.consumeDisplayEvent(+731)
    at javax.microedition.lcdui.Display$DisplayAccessor.consumeEvent(+109)
    at com.nokia.mid.impl.isa.ui.EventDispatcher.run(EventDispatcher.java:354)

    This is the line that cause the exception:
    player.stop();
    --> player.setMediaTime(player.getMediaTime()+10000);
    player.start();

    I get this exception in S40 5th emulator and N5310.

    Any idea what this execption means?

    Thanks!!

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: setMediaTime() Exception

    Yes. If you look at the documentation for Player.setMediaTime(), you'll see:
    Throws:
    IllegalStateException - Thrown if the Player is in the UNREALIZED or CLOSED state.
    MediaException - Thrown if the media time cannot be set.
    The player does not support setMediaTime(). Not all media types support setting the media-time. As a general rule, MIDI, yes, WAV, maybe, AMR and MP3, probably not.

    Graham.

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    4

    Re: setMediaTime() Exception

    So there's no way to jump an audio file (amr-mp3) in a specific position?

    ...Anyway the SO can do it... we will have to open the file at a byte-level and skip audio frames?

    Thanks Graham!

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: setMediaTime() Exception

    Whether or not setMediaTime() works is a function of the device and the media-type. You may find that this works on some devices, even though it does not work on these.

    I don't know enough about sound formats to tell you if you can do it manually, but I suspect you cannot, because you cannot play a partial file.

    Graham.

Similar Threads

  1. setMediaTime(..) Exception
    By manuel.astica in forum Audio
    Replies: 1
    Last Post: 2010-09-25, 03:25
  2. setMediaTime
    By felixksp in forum Mobile Java General
    Replies: 2
    Last Post: 2010-07-22, 12:00
  3. Problem with setMediaTime()
    By girdhar in forum Mobile Java General
    Replies: 0
    Last Post: 2010-03-24, 11:35
  4. setMediaTime and PlayerListener probs
    By henrygps in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2004-07-31, 00:10
  5. SetMediaTime / restarting sounds
    By Danack in forum Mobile Java Media (Graphics & Sounds)
    Replies: 7
    Last Post: 2004-05-17, 10:49

Posting Permissions

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