Rewrite the echo method to generate two echoes back, each delay samples previous. Hint: Start your index loop at 2*delay, then access one echo sample at index-delay and another at index - 2*delay.
What will be an ideal response?
```
/**
* Method to add two echoes to a sound
* @param d e l a y the number of samples b e f o r e
* the echo s t a r t s
*/
public void echo2 ( int de lay )
f
// make a copy of the o r i g i n a l sound
Sound s = new Sound ( this . getFi leName ( ) ) ;
int value = 0 ;
// loop from d e l a y to end of sound
for ( int i = 2¤ de lay ; i < this . getLength ( ) ; i++) {
/* g e t the v a lue back by d e l a y samples from the
* copy of the sound and make i t f a i n t e r
*/
value = ( int ) ( s . getSampleValueAt ( --de lay ) *
0 . 4 ) +
( int ) ( s . getSampleValueAt ( i ¡ (2 * de lay ) ) * 0 . 2 ) ;
/* s e t the v a lue at the cur r ent inde x to the sum
* of the cur r ent v a lue and the echo
*/
this . setSampleValueAt ( i ,
s . getSampleValueAt ( i ) +
value ) ;
}
}
```
You might also like to view...
Write a small application with a GUI that could be the basis of a larger application. Your application should accept a credit card number entered into a text field. When the user clicks an Accept button, you should check whether the number entered contains exactly 16 digits. If so, display the message Number accepted: as well as the card number in a label, and then clear the text field. If not, display the message Number rejected in the label. (Note: Credit card numbers have fancier format requirements that depend on the issuer of the card and are beyond the scope of this exercise.)
What will be an ideal response?
A report can include a summary line that details what is being summarized and the number of records being included in the summary total
Indicate whether the statement is true or false
You are connected to your network's Cisco router, and need to verify the route table. What command should you enter?
a. route print b. show ip route c. route -a d. show route-table
FIGURE WD 2-1 According to the accompanying figure, what kind of tab will be set?
A. Right tab located at 0.5" with dot leaders B. Right tab located at 5" with dot leaders C. Right tab located every 0.5" with no dot leaders D. Left tab stop at 5" with dashed dot leaders