Write a function to reverse part of the passed sound just between the passed start and end index.

In order to reverse part of the passed in sound, and not a copy of the sound, we need to copy out the entirety of the non-reverse section in order to avoid overwriting half of it as we reverse.


```
def reverseBetween(sound, startIndex, endIndex):
soundSamples = getSamples(sound)
target = makeEmptySound(endIndex-startIndex)
targetSamples = getSamples(target)

for index in range(startIndex, endIndex):
sourceValue = getSampleValue(soundSamples[index])
setSampleValue(targetSamples[index-startIndex], sourceValue)

for index in range(startIndex, endIndex):
sourceValue = getSampleValue(targetSamples[index-startIndex])
setSampleValue(soundSamples[endIndex-1-(index-startIndex)], sourceValue)
```

Computer Science & Information Technology

You might also like to view...

The ____ provides a code template for every event procedure.

A. Code Editor B. Template Editor C. Code Template D. Template Tool

Computer Science & Information Technology

The bits in the result of an expression using the _______ operator are set to one if at least one of the corresponding bits in either operand is set to one. Otherwise, the bits are set to zero.

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

Computer Science & Information Technology

Within SharePoint, three basic ________ exist for each site: visitor, member, and owner

Fill in the blank(s) with correct word

Computer Science & Information Technology

To access the Edit Relationships dialog box from a shortcut menu, ____ the join line between tables.

A. click and drag B. delete C. left-click D. right-click

Computer Science & Information Technology