We've seen a method that reverses a sound and a method that can process samples by index number.
Write a method called reverseLastHalf that reverses just the second half of the current sound. For example, if the sound said \MarkBark" the returned sound should say \MarkkraB."
```
public void reverseLastHalf ( )
{
Sound orig = new Sound ( this . getFi leName ( ) ) ;
int l ength = this . getLength ( ) ;
int half = length / 2 ;
// loop through the samples
for ( int t a r g e t Index = ha l f , sour c e Index = l ength - 1 ;
t a r g e t Index < l eng th && sour c e Index > 0 ;
t a r g e t Index++, sourceIndex --)
this . setSampleValueAt ( targe t Index ,
o r i g . getSampleValueAt ( sour c e Index ) ) ;
}
```
You might also like to view...
________ appear as you move an object, assisting with aligning it with existing text
Fill in the blank(s) with correct word
A ________ displayed on a slide in Normal view is one way of knowing that the slide has a comment
A) change indicator B) comment indicator C) checkmark D) thumbnail