Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Mar 2003

    AMR,WAV playing on N-Gage (and probably other s60 devices)

    Hi all,

    I'm currently having some problems with playing sound effects in our current game. I'm using the Mobile Media API. I have MIDI files playing fine and some of my WAV/AMR files. The problem is that some of the effects just doesn't want to play. Works fine on the emulator of course but nothing can be heard on the device.

    First I thought it was because the sounds where very short, I tried adding silence at the start and end to the files with no luck.

    When the game starts I create all the players needed (12 of them) and get volume controls for them also. Code is like this:

    try {
    java.io.InputStream is = m_nSoundType.getClass().getResourceAsStream("/" + (id + 1) +
    m_SoundPlayers[id] = Manager.createPlayer(is, "audio/amr");

    m_VolumeControl[id] = (VolumeControl) m_SoundPlayers[id].getControl("VolumeControl");
    catch (IOException ioe) {
    System.out.println("IOE amr : " + ioe);
    catch (MediaException me) {
    System.out.println("ME amr : " + me);

    I get no exceptions at all (I catch them all and show them while the game is running¡_ not in above code).

    If any of you had the same problems and found a solution then please let me hear about it..

    Another issue also related to this. In the above code I get the VolumeControl just after I created the player, but to me it seems that I have to get the VolumeControl just after I started to play the sound, otherwise I fail to change the volume. Since there always are delays and latency it often happens that a sound is started and then you hear the very first start of it with full volume and then it changes to the volume I defined (could be 0). Any comments on this ?



  2. #2
    Regular Contributor
    Join Date
    Mar 2003

    6600: Symbian OS Error

    I just tried the game on a Nokia 6600 and when playing sounds I now get Exception errors and it is following:

    Symbian OS Error : -4
    and -25

    I get -4 as a media exception while preparing the AMR sounds.

    -25 is when I try to play one of the sounds...

    Not 100% sure if I look at the right place but when looking at
    I see that -4 is : KErrNoMemory "Not enough memory. Close some applications and try again"

    and -25 is :KErrEof "Unexpected end of file"

    Does not make sense really.


  3. #3
    Registered User
    Join Date
    Mar 2003
    6600 supports only 6 players in prefetched state at the time. you should prefetch them on the fly before playing and deallocate after but:

    a) this will introduce lag
    b) you can play each sound only one time because inputstream doesn't support seeking

    nokia suggests you close the player every time sound is stopped and recreate it again but this results in even bigger lag.

    the only solution for speeding up realize() is using manager.createplayer(datasource source) with custom datasource and sourcestream classes which will support random seeking.

    the bad news is i can't get that to work. mediaexception tells me this thing is not supported on 6600 but nokia says it is.

    if you succeed with datasource/sourcestream pls post an example here!


Posting Permissions

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