Yong Min Administrator
Gender :  Posts : 144 Points : 409 Reputation : 27 Join date : 2011-11-11
 | Subject: RSC Sounds Mon Jan 16, 2012 12:11 pm | |
| Unfortunately, some of the RSC sources were released without sounds. If you want to add sounds to your source, you can do that by simply tweaking the AudioReader class (client side). Go into your client folder and follow the following dir. - Quote :
src - org - rscdaemon - client
When at that destination, open your AudioReader class and replace it with: - Code:
-
package org.rscdaemon.client;
import sun.audio.AudioPlayer;
import java.io.InputStream;
public class AudioReader extends InputStream {
public AudioReader() { AudioPlayer.player.start(this); }
public void stopAudio() { AudioPlayer.player.stop(this); }
public void loadData(byte abyte0[], int i, int j) { dataArray = abyte0; offset = i; length = i + j; }
public int read(byte abyte0[], int i, int j) { for (int k = 0; k < j; k++) if (offset < length) abyte0[i + k] = dataArray[offset++]; else abyte0[i + k] = -1;
return j; }
public int read() { byte abyte0[] = new byte[1]; read(abyte0, 0, 1); return abyte0[0]; }
byte dataArray[]; int offset; int length; }
| |
|