Dana Vrajitoru
I310/D513 Multimedia Arts and Technology

I310 Lab 7

Date: Tuesday, October 4, 2016. Due: Tuesday, October 25, 2016.

In this lab we will see some examples of creating and manipulating digital audio files.

Ex. 1. a. Text to Speech.

Log on to the following page:
http://codewelt.com/proj/speak

A demo page should show up where you can enter a piece of text in English or a few other languages and convert it to speech using a selection of voices.

Enter some text to convert to speech (whatever you want). Click on Speak the Text Area to try it out.

You can try several voices and choose the one you prefer.

Once you have chosen the voice and the text, click on Download.

This will open a new window with an mp3 file.

From the File menu, choose Save Page As and save it to your account. Give it a name that's easy to remember.

The file should now be on your hard drive. You can close the browser window.

b. Audio Manipulation

Open Audacity. From the File menu, open the file that you just created in the previous exercise. Play the clip to make sure it's the same. Select the entire range of the clip with Ctrl-A.

We will now apply some effects on this file. Effects can be accessed from the Effect menu, and they normally apply to the selection.

Pitch and Tempo

From the Effect menu, choose Change Pitch. Experiment moving the cursor bellow "Percentage Change" up and down, and click on Preview to hear the effect. When you are satisfied with the change click ok. Repeat the operation with Change Tempo.

Echo

From the Effects menu, click on Echo. A dialog will open to specify the delay time and the decay factor. Set the delay to around 0.15 and the decay  to about 0.2. Play the clip to hear the result. If you're not satisfied with it, undo the operation with Ctrl-z then do it again and adjust the parameters.

You can play with the other effects for fun and if any of them has a pleasant result, you can leave it in (otherwise just undo the operation).

Export your file in the wave format first under a different name (add "echo" for example to the name), then try to save it in mp3 format.

If it doesn't work, open the following link: http://manual.audacityteam.org/o/man/faq_installation_and_plug_ins.html#lame, then click on the Lame Download Page and then on the Windows version of Lame. Unzip the folder and copy it to your account. Then go back to Audacity and try to save it as mp3 again. This time when the program asks you if you want to locate the lame_enc.dll file now, select the file with that name in the folder that you copied to your account.

If the installation doesn't work, download the zip file lib...lame.zip from the folder Files - Week 7 - Lab 7 on Canvas, unzip it locally, and select the file lame_enc.dll from inside when asked. It's an older version of the library but it should work. On your home computer, you should only have to do this once.

Ex. 2. Editing

Create a new project (File - New)

This should open a new empty window. You can close the old window (you don't need to save the changes). 

Open the Pinball program (from the games menu) and let the startup sound clear out. Go back to Audacity.

If you do this at home, follow the instructions below:

In the toolbar bellow the main one (just above the time scale) you should see a drop-down menu. Make sure that it says Microphone. This will be the built-in microphone at the top of your screen. If you are using headphones, take them off for this operation. Make sure you're not doing this operation at the same time as your neighbor. Then click on the record button above (round red button). Note that the program starts recording sound, simply silence for now. Go back to the Pinball and start a new game. Wait until the ball settles down, then go back to Audacity and stop the recording. If the Pinball doesn't work, use the system sounds instead (control panels - Sound and Devices). You should now have an audio clip with the sound played in the game.

If you do this in class:

Download the clip carpenter.wav from Canvas - Files - Week 7 - Lab 7.

We will aim to extract and process a piece of this clip to use as a sound effect in a game. For example, the sound of clicking on a tile to select it in a puzzle game.

Clipping

If the clip contains some periods of silence at the beginning and at the end, we will now delete them.

Go to the beginning of the clip. Make sure that the cursor is in selection mode (the first of the options), then select the part of the clip that is just silence from the beginning. From the Edit menu, select Delete (or Ctrl-K). Repeat the operation to remove the silence at the end.

Next, we will select a piece of the clip that can be turned into a click.

Choose a piece of the clip that contains a spike. Select a portion of the clip containing the spike and some of the interval before and after, but without another spike.

For best results, aim for the selection to begin and end in near silence, or background noise.

Play this piece to see if it sounds like a click. If you are satisfied with it, from the toolbar above the timeline, click on Trim Audio.

This should delete everything else from the audio track and leave us with just the click. But it's most likely now somewhere in the middle of the track. We would like it to start from the point 0.0 in the timeline.

With the remaining part still selected, click on the Time Shift Tool (a double arrow in the toolbar). Move the selection to the beginning of the timeline.

Fade In - Fade Out

These two effects are designed to create a smooth transition into and out of the clip.

Select a small portion at the beginning of the track and apply Fade In to it from Effects. Then select a small part of the track at the end and apply Fade Out to it.

Note the effect on the aspect of the audio signal.

Amplify

Let's set the volume of the clip properly.

Select the entire clip, then from the Effect menu, select Amplify.

If your sound wave looks small, amplify it by a positive amount to hear it better. If your sound wave is too big, choose a negative amplification (reducing the volume), and click on Preview to hear the effect. When you are satisfied with the result, click ok.

Reverse and Filter

Select the entire clip (Ctrl-A). From the Effect menu, choose Reverse. Play the clip to hear the effect. Then apply a Low Pass Filter with the default parameters to your clip (the same menu).

You can try other effects to see if the result is better.

Export this clip as mp3. and call it click.mp3.

If you can't export to mp3, export it as a wave. It should be a fairly small file anyway.

Ex. 3. Mixing

Download the following three clips: dance1.mp3, dance2.mp3, and dance3.mp3. Choose one of them that is more appropriate for the text to speech that you created for ex. 1.

We will now create a mix of the speech file with one of these files using several tracks in the timeline.

Open the speech clip you created before in Audacity. From the Project menu, select Import Audio, then select the music track you have chosen.

Your project should now contain two tracks (one being stereo).

Select the entire speech track. Switch to the Time Shift Tool we've used before (the double horizontal arrow). Move the speech track to the end of the clip such that it overlaps a little bit with the music.

The music track will be followed by the speech track. We want to replicate the music track after the speech ends, so we need to use copy and paste for it. But first, we need to create a portion of silence in the second track over the speech part.

Switch back to a selecting cursor. Select an empty region in the music track from the point where the music ends till almost the end of the speech track (leave a bit of space for overlap). From the Generate menu, choose Silence, then click ok (the number of seconds should correspond to your selection). Unselect the region.

Now that we created a place for the music track to be copied to, we can proceed with it.

Select the entire region containing the music in the music track (but not the silence). Copy it with Ctrl-c. Click somewhere after the silence in the music clip and paste the music with Ctrl-V.

The transition between music and speech is still too sudden. Let's smooth it out.

Select a region in the music track starting a little bit before the speech and ending where the silence region starts (it doesn't matter if you go over the silence a little bit. From the Effect menu, choose Fade Out. To check out the result, select a region in the music track starting before the speech and going till after the speech, then click on the Play button.

If the result is not satisfactory, you can undo the operation and start over.

Unselect the region, then select a region in the music track (the copied part) starting at the end of the silence region and going a little bit over the end of the speech track. Apply a Fade In effect to it. Check your result.

Let create a smooth transition at the beginning and end of the entire project.

Apply a Fade In and Fade Out effect to the beginning and to the end of the music track.

We are done with the editing, now we need to create the final result.

Save your project in Audacity native format (.aup) under a new name. Export the project as an mp3.

Here is an example of a file created for this project.

Lab submission. Upload to Canvas all the mp3 files that you created in this lab. If saving as an mp3 didn't work, upload the .wav files instead. You can create a zip file containing all the files you want to submit and upload it instead. You will have more files to prepare for the homework.