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 :
--- Last problem : the simulator can play a background music in Midi and my special effects (collision by example) in same time, unlike the phoneCode: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 ); }
If anyone has met one of these problems and may be few solutionsi'm waiting for your testimonies.


i'm waiting for your testimonies.
Reply With Quote
)

