×

Discussion Board

Results 1 to 7 of 7

Thread: Sound and S40

  1. #1
    Registered User
    Join Date
    Jun 2006
    Location
    Grenoble
    Posts
    20

    Sound and S40

    Hi,

    I'm working on a game (using MIDP, jsr-226) for nokia S40, and I met some problem with the sound. Especialy I ve noticed few differences between the phone and the simulator.

    -- My biggest problem consists of an additionnal noise (crackling, or beep sometimes (this noise can change for the same wav)) played after my original wavs. My wavs match with the recommendation ( 8bit , 8kHz , mono, PCM). And this noise appears only on the phone (nokia 6280 (S40)) not on the simulator.

    -- Second problems, obviously my sounds slow down the game. with lag before playing the sound. And I ve not seen the cause in my (classical) code :
    Code:
    public class ShotSounds implements PlayerListener{
    
      // for playing sounds (fired shots )
      private Player shotPlayers;
    
      public ShotSounds(){
        // load fired shot sounds
        shotPlayers = loadSound("/sounds/wood.wav");
    
     private Player loadSound(String fn)
      // load fn sound
      {
        Player p = null;
    	try{
          InputStream in = getClass().getResourceAsStream(fn);
          p = Manager.createPlayer(in,"audio/x-wav");
          p.realize();
          p.prefetch();    // move player to PREFETECHED state
    	}
        catch(Exception ex)
        { System.out.println("Could not load sound in " + fn);  }
    
        return p;
      }
    
      public void playShotSound(){ 
    	 playSound( shotPlayers );
      }
    --- Last problem : the simulator can play a background music in Midi and my special effects (collision by example) in same time, unlike the phone


    If anyone has met one of these problems and may be few solutions i'm waiting for your testimonies.
    Don't too much care about your life, in all the cases you will not survive.

  2. #2
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: Sound and S40

    Hi,
    I am working on the same phone .but it works fine for me.can you check the phone software and tell.
    thanks
    soku

  3. #3
    Registered User
    Join Date
    Jun 2006
    Location
    Grenoble
    Posts
    20

    Re: Sound and S40

    The software is the one of nokia.

    I tried my soun on an other phone (the same but an other) and the sound do the same thing.

    So i m gonna try with other sound, may be my 4 sound ( taken from different places) are corrupted ( big coincidence) .

    An may be anything is bad in my code ...
    Don't too much care about your life, in all the cases you will not survive.

  4. #4
    Registered User
    Join Date
    Jun 2006
    Location
    Grenoble
    Posts
    20

    Re: Sound and S40

    And do you use the same code than me for the sounds ?
    It seems to be the classical use ... :/
    Don't too much care about your life, in all the cases you will not survive.

  5. #5
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: Sound and S40

    Hi,
    Check with another good quality sound.

    Thanks
    Soku

  6. #6
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: Sound and S40

    Hi,

    i think u r using a sound file of big size. it will be better if u try with a sound file with small size. if possible relpace the wav file with a midi file and try again

    wang

  7. #7
    Registered User
    Join Date
    Jun 2006
    Location
    Grenoble
    Posts
    20

    Re: Sound and S40

    I m working with 6 different wavs, from 1,39 Ko to 16,2 Ko , after each sound, i have my perturbation, parasite (crakling, noise) in addition of my original sound.
    I tryed all the frequencies accepted by the phone (11kHz and 8kHz).
    I m gonna look for another sound with best quality (if i find).

    But i'm really disturbed by this problem, because i can't see :
    - why ALL my sounds don't work correctly (conclusion ==> it doesn't seem to come from the sound or i'm very unlucky)
    - Apparently wav work on other game (I think some games have sound or just mine ? )
    - How a crackling could come from my code ??? (it seems strange, but I think it's the only answer)

    Wang, the midi i used , works fine, but i have to reproduce car skid sound and midi is not the best solution . For the same reasons, i don't use the tone generation provided by the phone, but it works too.

    (and to conclude i hope the "work" has the same meaning than "function" because i use it all the time )

    thanx for your interest ^^
    Don't too much care about your life, in all the cases you will not survive.

Similar Threads

  1. Sound Duration (S40, com.nokia.sound.Sound)
    By srx3 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2004-10-10, 14:43
  2. Porting sound playing code for all nokia's phones
    By civax in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2004-05-17, 10:44
  3. suporting sound in a game
    By shmulikm29 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-04-20, 11:56
  4. About Sound
    By linjunan in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2003-10-31, 02:01
  5. Sound in Java question
    By linjunan in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2003-10-08, 14:56

Posting Permissions

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