×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    9

    mp3 and midi simultaneously

    Hello I have a problem with the sound. In memory simultaneously hold multiple MIDlet mp3 files. But still I have to play midi sounds. Work individually and mp3, and midi. But if you play them with the following happens:
    Code:
    javax.microedition.media.MediaException: AUD
    null
    null
    null
    null
    null
    null
         at mobak.game.sound.SoundPlayer.playMusic (+80)
         at mobak.connection.gameMessage.MessageProcessor.cityEntry (+45)
         at mobak.connection.gameMessage.MessageProcessor.execute (+567)
         at mobak.connection.gameMessage.MessageProcessor.execute (+43)
         at mobak.connection.SocketListenerMeInputSocketStream.compileGameCommand (+18)
         at mobak.connection.SocketListenerMe $ InputSocketStream.putToDataGramm (+96)
         at mobak.connection.SocketListenerMe $ InputSocketStream.run (+187)
    Is it possible to play two types of sounds at once? And how?

  2. #2
    Nokia Developer Moderator
    Join Date
    Dec 2011
    Posts
    174

    Re: mp3 and midi simultaneously

    Hi alexmelyon,

    It is possible to play two types of sounds at once on devices that supports Audio Mixing. You can check if your device supports Audio Mixing with the system property supports.mixing.
    Code:
    if(System.getProperty("supports.mixing"))
    {
    	System.out.println("Audio mixing supported");
    }
    -tiviinik

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    9

    Re: mp3 and midi simultaneously

    Ok. I have the "supports.mixing = true", but an exception occurs. And the Nokia SDK, and the real device.
    well, not. everything is fine. I just do not have enough memory for simultaneous loading and pre-fetch all the sounds.
    Last edited by alexmelyon; 2012-03-30 at 07:02.

  4. #4
    Nokia Developer Moderator
    Join Date
    Dec 2011
    Posts
    174

    Re: mp3 and midi simultaneously

    Could you give some more information where the exception is thrown and a code snippet of your code. What device and SDK are you using?

    -tiviinik

  5. #5
    Nokia Developer Moderator
    Join Date
    Dec 2011
    Posts
    174

    Re: mp3 and midi simultaneously

    You could also check the Multimedia - Media Sampler example and try if it works to play the midi file and the wav file simultaenously on your device.

    http://library.developer.nokia.com/i...2A6F80934.html

    -tiviinik

  6. #6
    Registered User
    Join Date
    Mar 2012
    Posts
    9

    Re: mp3 and midi simultaneously

    I have SDK 1.1 and my code was as follows:
    try{
    for(int i=0;i<SOUNDS_LENGTH;i++)
    {
    effectsPlayers[i]=Manager.createPlayer (getClass ().getResourceAsStream (effectsFileNames [i]), "audio/mp3");
    effectsPlayers[i].realize();
    effectsPlayers[i].prefetch();//this line throws an exception
    }
    }
    catch(MediaException e)
    {
    e.printStackTrace();
    }
    catch(IOException e)
    {
    e.printStackTrace();
    }

  7. #7
    Nokia Developer Moderator
    Join Date
    Dec 2011
    Posts
    174

    Re: mp3 and midi simultaneously

    Hi alexmelyon,

    So if I understand you correctly the exception comes because you are running out of memory. Is that so?

    -tiviinik

  8. #8
    Registered User
    Join Date
    Mar 2012
    Posts
    9

    Re: mp3 and midi simultaneously

    Yes. and even if you do not use player.close () in five minutes, the application throws OutOfMemory. so that the player to observe the life cycle is very important. I've already figured out the task. here as something necessary to mark a thread closed? I have not found anything like it.

Similar Threads

  1. Replies: 2
    Last Post: 2010-06-07, 23:30
  2. Playing MIDI events / MIDI files in Symbian C++ on S60
    By codepatch in forum Symbian Tools & SDKs
    Replies: 4
    Last Post: 2010-02-23, 16:04
  3. how many midi files can i play simultaneously?
    By ehdgh32 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2007-03-14, 02:51
  4. MIDI file or MIDI mime-type in MMS for Nokia 6600?
    By Imperator of the Universe in forum General Messaging
    Replies: 3
    Last Post: 2004-05-03, 08:09
  5. Replies: 0
    Last Post: 2003-09-02, 17:23

Posting Permissions

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