Reversing half a sound and putting it at the front
I will admit this is a class project and I don't want the answer. I just want a shove in the right direction. I need to take a sound and reverse the second half of it and then place that reversed half at the beginning of the sound. I simply do not know where to begin. Please help.
This is what the reverseSnd looks like:
public Sound reverseSnd() {
Sound target = new Sound(getLength());
int sampleValue;
for (int srcIndex = 0, trgIndex = getLength() - 1; srcIndex < getLength(); srcIndex++, trgIndex--) {
sampleValue = this.getSampleValueAt(srcIndex);
target.setSampleValueAt(trgIndex, sampleValue);
}
return target;
}