Write a method called erasePart to set all the samples in the 2nd second of "thisisatest.wav" to 0's-essentially, making the 2nd second go silent. (Hint: Re- member that getSamplingRate() tells you the number of samples in a single second in a sound.) Play and return the partially-erased sound.
What will be an ideal response?
```
public void erasePart ( int s t a r t , int end )
{
for ( int i = s t a r t ; i < end ; i++)
{
this. etSampleValueAt ( i , 0 ) ;
}
}
public static Sound erase2ndSecThis IsATest ( )
{
Sound s = new Sound ( Fi l eChoos e r . getMediaPath ( " t h i s i s a t e s t .wav" ) ) ;
int numInSec = ( int ) s . getSampl ingRate ( ) ;
s . e r a s ePa r t ( numInSec , 2 * numInSec ) ;
s . play ( ) ;
return s ;
}
```
You might also like to view...
By default, when turned on, Outlook will archive messages every ____ days.
A. 6 B. 7 C. 14 D. 21
Define Web 2.0.
What will be an ideal response?
To move a window, you drag its ____________________ - the area across the top of the window that displays the window name or program name.
Fill in the blank(s) with the appropriate word(s).
The following sentence applies number rules correctly. Mr. Rios invested nearly 50 percent of the startup capital.?
Answer the following statement true (T) or false (F)