Compose a sentence that no one ever said, by combining words from other sounds into a grammatically correct new sound.
Write a method named audioSentence to generate a sentence out of individual words. Use at least three words in your sentence! You can use the words in the mediasources folder on your CD or record your own words. Be sure to include a tenth (1/10) of a second pause between the words. (Hint 1: Remember that zeroes for the sample values generate silence or pause.) (Hint 2: Remember that the sampling rate is the number of samples per second. From there, you should be able to figure out how many samples need to set to zero to generate a 1/10 of a second pause.) Be sure to access your sounds in your Media Folder using getMediaPath so that it will work for users of your program as long as they first execute setMediaPath.
```
public void audioSentence ( )
{
int numInSec = ( int ) this . getSamplingRate ( ) ;
int pauseLength = numInSec/10 ;
Sound s1 = new Sound ( FileChooser.getMediaPath ( " guzdial .wav" ) ) ;
Sound s2 = new Sound ( FileChooser.getMediaPath ( " is .wav" ) ) ;
Sound s3 = new Sound ( FileChooser.getMediaPath ( " great .wav" ) ) ;
int t o t a l = 0 ;
// copy s1 into the current sound
this . splice ( s1 , 0 , s1 . getLength ( ) , 0 ) ;
t o t a l = s1 . getLength ( ) ;
// put 1/10 sec of si lence
for ( int i = 0 ; i < pauseLength ; i++)
this . setSampleValueAt ( total + i , 0 ) ;
// copy s2 int o the current sound
o t a l = s1 . getLength ( ) + pauseLength ;
this . s p l i c e ( s2 , 0 , s2 . getLength ( ) , t o t a l ) ;
// put 1/10 s e c of s i l e n c e
t o t a l = t o t a l + s2 . getLength ( ) ;
for ( int i = 0 ; i < pauseLength ; i++)
this . setSampleValueAt ( t o t a l + i , 0 ) ;
// copy s3 int o the current sound
total = total + pauseLength ;
this . splice ( s3 , 0 , s3 . getLength ( ) , total ) ;
}
```
You might also like to view...
Executing tasks (as opposed to instructions) in parallel is called __________.
a. pipelining b. superpipelining c. hyperthreading d. multithreading
_____ is the control or suppression of the publishing or accessing of information on the Internet.
Fill in the blank(s) with the appropriate word(s).