Write a method to quadruple the frequency of a sound.

What will be an ideal response?


```
/**
* Method to quadruple the frequency of a sound by taking
* every fourth sample. The result will be a higher
* sound.
*/
public void quadFreq ( )
f
// make a copy of the original sound
Sound s = new Sound ( this.getFileName ( ) ) ;
/* loop through the sound and increment target index
* by one but source index by 4 and settargetvalue
* to the copy of the original sound
*/
int target Index = 0 ;
for ( int source Index=0;
source Index < this.getLength ( ) ;
source Index=sour c e Index+4, t a r g e t Index++)
this. setSampleValueAt ( targe t Index ,
s.getSampleValueAt ( source Index ) ) ;
// clear out the rest of this sound
for ( int i = target Index ;
i < this.getLength ( ) ;
i++)
this . setSampleValueAt ( i , 0 ) ;
}
```

Computer Science & Information Technology

You might also like to view...

When the insertion point is positioned in the last cell of a table, pressing [Tab] inserts a new blank row at the bottom of the table

Indicate whether the statement is true or false

Computer Science & Information Technology

You can paste an image of an open file, called a screenshot, into an Excel workbook.? ____________________

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Case OL 5-1Jesse is a financial officer for a real estate firm. He spends most of his day meeting with agents and customers regarding financial matters and must keep his calendar up to date to avoid overscheduling his time. Jesse has two calendars: a personal calendar and a work calendar. He wants to display both of them on the screen at the same time. Where are the show/hide calendar check boxes located?

A. Calendar Options dialog box B. Navigation Pane C. Home tab D. Appointment window

Computer Science & Information Technology

Discuss how the order of precedence works in the formula =25+2/3 and =(25+2)/3. Describe the order of calculations in your answer.

What will be an ideal response?

Computer Science & Information Technology