Write a function to add 1 second of silence to the beginning of a sound. It should take the sound as input, create the new empty target sound, then copy the original sound starting after the first second in the target.

Note: The sampling rate has to be of type int if its going to work with index array notation.

```
def addStartSilence(sound):
sampleRate = int(getSamplingRate(sound))
target = makeEmptySound(sampleRate+getLength(sound))
targetSamples = getSamples(target)
sourceSamples = getSamples(sound)
for index in range(0, getLength(sound)):
sourceValue = getSampleValue(sourceSamples[index])
setSampleValue(targetSamples[sampleRate+index] ,sourceValue)
return target
```

Computer Science & Information Technology

You might also like to view...

A zero-degree polynomial is called a __________ polynomial and is simply an element of the set of coefficients.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The IllegalArgumentException class extends the RuntimeException class and is, therefore, __________.

a. a checked exception class b. an unchecked exception class c. never used directly d. None of these

Computer Science & Information Technology