Hi i am trying to play sounds in 7650 and using the emulator to test the application. its a game application. here is the code i am using the load the sounds. what is happening is that the application freezes after making 1 or 2 sounds.
i use this statement to play the sound
sound1.play(1); to play once.
Also i use the following statement to play the sound
sound5.play(0); to play the background continuous music sound.
please tell me what is making the program to ferrze
also what i want to do is that there should be a continuous sound and some sounds that are hear when there is some event in the game.
Shahzad
tune = this.getClass().getResourceAsStream("/Dragon1/res/scn/punch1.wav"
byte[] buffer = new byte[8000];
tune.read(buffer, 0, buffer.length);
sound1 = new Sound(buffer, Sound.FORMAT_WAV);
sound1.init(buffer, Sound.FORMAT_WAV);
tune = this.getClass().getResourceAsStream("/Dragon1/res/scn/punch2.wav"
tune.read(buffer, 0, buffer.length);
sound2 = new Sound(buffer, Sound.FORMAT_WAV);
sound2.init(buffer, Sound.FORMAT_WAV);
tune = this.getClass().getResourceAsStream("/Dragon1/res/scn/ss1.wav"
tune.read(buffer, 0, buffer.length);
sound3 = new Sound(buffer, Sound.FORMAT_WAV);
sound3.init(buffer, Sound.FORMAT_WAV);
tune = this.getClass().getResourceAsStream("/Dragon1/res/scn/ss2.wav"
tune.read(buffer, 0, buffer.length);
sound4 = new Sound(buffer, Sound.FORMAT_WAV);
sound4.init(buffer, Sound.FORMAT_WAV);
tune = this.getClass().getResourceAsStream("/Dragon1/res/scn/back.wav"
buffer = new byte[40000];
tune.read(buffer, 0, buffer.length);
sound5 = new Sound(buffer, Sound.FORMAT_WAV);
sound5.init(buffer, Sound.FORMAT_WAV);
buffer = null;

;
Reply With Quote

