Try rewriting the Program so that you have a linear increase in volume to halfway through the sound, then linearly decrease the volume down to zero in the second half.
What will be an ideal response?
```
public void linear IncreaseDecrease (double maxChange )
{
int length = this . getLength ( ) ;
int half = length / 2 ;
double change = maxChange / half ;
double totalChange = change ;
int value = 0 ;
// loop increasing each time to half
for ( int i = 0 ; i < h a l f ; i++)
{
value = this . getSampleValueAt ( i ) ;
value = ( int ) ( value * totalChange ) ;
totalChange = totalChange + change ;
this . setSampleValueAt ( i , value ) ;
}
// loop decreasing each time to end
for ( int i = h a l f ; i < this . getLength ( ) ; i++)
{
value = this . getSampleValueAt ( i ) ;
totalChange = totalChange - change ;
value = ( int ) ( value ยค totalChange ) ;
this . setSampleValueAt ( i , value ) ;
}
}
```
You might also like to view...
By creating a __________, a user can cause a series of command language commands to be executed in sequence.
a. batch file b. command file c. primitive file d. source file
For a calculated field, the new field name must be followed by:
a. a bracket b. a colon c. an underscore
?The same message to two different objects produces the same results.
Answer the following statement true (T) or false (F)
When issuing thels -Fcommand, what special character indicates a linked file?
A. @ B. * C. & D. =