When I tried to play a sound for selecting adjacent tiles in an N70, no sound is been heard and the fps drops down.
Concurrently I was playing a MIDI in as background music. I use only a single user thread.
I turned off the background music, then sounds are ok.
Please help me to play music and sound at the same time.
Sound details: 7KB, 8bit, mono, WAV
Code:private void playSound(String strSound) { try{ if((getAudioStatus() & GameState.SOUND_BIT) != 0) { InputStream is = getClass().getResourceAsStream(strSound); if(soundPlayer != null) { soundPlayer.close(); } soundPlayer = Manager.createPlayer(is, "audio/X-wav"); soundPlayer.realize(); soundPlayer.prefetch(); soundPlayer.start(); //Manager.playTone(MusicMaker.D4, 300, 90); //long timeout = soundPlayer.getDuration()/1000L; //microseconds = milliseconds*1000 //System.out.println(timeout);//millisecs //if(timeout<=0) //timeout =20L; //synchronized(this){ // wait(50L); //} is.close(); } }catch(Exception e){ e.printStackTrace(); } }






