< Back

Lab 13: Sounds

For all of our activities, make sure your practice with the new blocks today. Some of the activities you can complete without using the new blocks. They do save some time and headaches. Open up the Practice Area, and take a crack at the following activities.


Activity 1: Delete Last Second

Create a blockly program which allows the user to load in a .wav file, and deletes the last second of the audio. Remember that an entire second of the sound file is represented as 44100 samples in the list created. You can use the following wav file if you cannot find one: tada.wav


Activity 2: Reverse

Create a blockly program which allows the user to load in a .wav file, and plays the wave file backwards. You can use the following wav file if you cannot find one: tada.wav.

To reverse an audio file, you must first go and create a list which contains all of the samples from the sound in reverse order. To accomplish this, you should create an initially empty list, and add all of the samples from the sound into it. Then just copy from this list back into the original sound list.