How to debug the program:
the Netbean say it loss precision, as a beginner of java, I am looking for the kindly help... thanks!
public synchronized void compress(int threshold, int ratio) {
// Loop through all audio data in the buffer
for (int i=0; i<this.dataLeng th; i++) {
int temp = Math.round(buff er[i]);
// if clipping found restricting the range from -128 to 127 (8 bit)
if (temp < threshold) buffer[i] = threshold;
else if (temp > threshold ) buffer[i] = (temp-threshold)/(ratio+threshol d);
else buffer[i] = (byte)temp;
}
}
the Netbean say it loss precision, as a beginner of java, I am looking for the kindly help... thanks!
public synchronized void compress(int threshold, int ratio) {
// Loop through all audio data in the buffer
for (int i=0; i<this.dataLeng th; i++) {
int temp = Math.round(buff er[i]);
// if clipping found restricting the range from -128 to 127 (8 bit)
if (temp < threshold) buffer[i] = threshold;
else if (temp > threshold ) buffer[i] = (temp-threshold)/(ratio+threshol d);
else buffer[i] = (byte)temp;
}
}
Comment