×

Discussion Board

Results 1 to 7 of 7

Thread: Media Exception

Hybrid View

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    22

    Media Exception

    working on 3650 with multimedia api.. playing MIDI files using Player. First time my sounds play fine. When playing sounds again, i get the following error from my prefetch call:

    javax.microedition.media.MediaException: Cannot set sequence to MIDI sequencer

    has anyone seen this before? it seems like i cant get access to the audio device, but im not sure..

    thanks in advance for your help..

  2. #2
    Registered User
    Join Date
    Jan 2004
    Posts
    5
    Having the same problem. Has anyone figured it out? Please help.

    GABE

  3. #3
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Mumbai,India
    Posts
    82
    Are you playing more than 1 MIDI Sounds?
    May be simultaniously?

  4. #4
    Registered User
    Join Date
    Jan 2004
    Posts
    5
    No the sounds are only being played one at a time. Most of the time they are not even interupting each other. I create a bunch of players when the app is started and every sound will play the frist time it is needed but after that it will throw a MediaException.

    Since other players can play I don't think it's a problem of trying to get hardware resouces so I have to assume this is a problem with gathering the sound data the second time. It needs to be reinitallized or something I think. I just donno how that can be done without creating a new sound player each time.

    Thanks for your help,
    GABE

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    6
    that could be because you can have only 10 player objects in memory at one time and its not sufficient just null the object, you need to close the player object properly so you can free space for further players.

  6. #6
    Registered User
    Join Date
    Jan 2004
    Posts
    5
    But they are all in memory the whole time and they work the first time they are played but not the subsequent times. Closing an nulling out the player object (which means i have to create a new one each time i want to play a sound) will play the sound each time (ususally) work but begins to fragment memory (due to the non compacting garbage colloector) which causes Memory Full exceptions eventaully. Keeping all the player objects in memory is a better solution if it can be made to work. (Which I'm not sure it can be.)

    GABE

  7. #7
    Registered User
    Join Date
    Sep 2003
    Posts
    34
    Well, here is what I guess for your situation.

    The first time you call the player, it works fine since it is just realized.
    After playing the sound, the player is left at the end of the media. What you have to do is to stop it before play it again so that the media start at the beginning in the next time you play. I would suggest that after you switched the player, stop it before you play it.

    Since I haven't tried to use create several players in the memory, please tell me whether you have make this success or not.


    P.S Please forgive my poor English, as I am not a native speaker and I'm typing this in hurry.

Posting Permissions

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