Insert instructions for scheduling in the P-lab / using that equipment
We use Audacity to edit sound files for my experiments. There are four ways we typically edit my sound files. Select the best sample of a given stimulus, Remove background noise, Add or remove silence if necessary, and Export as a
First, select the file that you want to work on.
Right click to open the sound file you want to work on with Audacity.
With the sound file open, listen to each of the recorded examples of the sound and select the one that sounds best to you.
To select in Audacity you just click and drag around the sound that you want. In this example, I've selected the first one. Make sure that you get at least a little bit of the silence around the sound. You will need it to remove background noise later.
With the best sound selected, hit
cmd + cto copy it to the clipboard. Open a new audacity file by hitting
cmd + n. Then paste the selected sound file into the new audacity file with
cmd + v.
To remove background noise, we first need to zoom in to our sound stimulus. Use
cmd + 1to zoom in. (Note that
cmd +3zooms out and
cmd + 2returns the sound stimulus to its original size.)
Next we need to select a part of the silence to give Audacity a "noise profile". Do this by clicking and dragging around the silence that you want to select.
Effect > Noise Reductionto open the "noise reduction" dialog box.
With your silence already selected and the "noise reduction" dialog box open, click the
Get Noise Profilebutton.
Next, go back to the sound stimulus and select the entire audio sample.
Effect > Noise Reductionagain to return to the "noise reduction" dialog box. This time select
You can adjust the dB of noise reduction, the sensitivity, and the smoothing. For my experiments, the default selections are appropriate. For reference, those default selections are:
- Noise reduction (dB) : 12
- Sensitivity: 6.00
- Frequency smoothing(bands): 0
To remove silence (or any section of the stimulus), select the portion of want to remove and click
To add silence, place the cursor where you want to add the silence. Here I've chosen the end of the stimulus.
Generate > Silence...from the Audacity menu.
In the "silence" dialog box, enter the amount of silence you want to generate. Here I have entered 30 seconds of silence.
OKto finish generating silence.
To export the final stimulus, select
File > Export Audio...or
File > Export Selected Audio...if you have selected a smaller portion of a file to export.
Enter a file name and select
Save. You can enter meta-data if you wish to. I often leave this part blank.
OKto finish exporting your stimulus.
To synthesize sounds, you can use the
saycommand in the terminal. For example, to synthesize a single sound, you would type
Each parameter in this command are:
sayis the command for Text-to-speech
-v Alexuse voice (
-r 250use a rate of 250 ms
"say this please"is the text you want to synthesize
-o ~/Desktop/say-this.wavis the path and name of the file you want to save
When I want so synthesize a short list of words or sentences with exactly the same parameters, I use my synth-a-little.py python script.
The parameters in the script are:
pathis the name of a folder I want to create to save my sound files in
voiceis the voice I want to use
rateis the speech rate
wordListis a list of words or sentences that I want to synthesize
To download the script, navigate to the directory you want to save the script in. For example, the Desktop.
curlto download the script.
curl -o synth-words.py https://raw.githubusercontent.com/kschuler/helpers/master/synth-a-little.py
To run the script, first edit synth-a-little.py with the parameters you want to use. Then navigate to the script's directory. For example, if you saved
synth-a-little.pyon your Desktop you would navigate to the Desktop
And then run the script using
When I need to synthesize a long list of sounds, or a list of sounds with different parameters, I use my synth-a-lot.py script. This script reads parameters from a
.csvfile for each individual sound file.
Instructions coming soon...
When you are looking for images to use as stimuli, generally any open-source image search tool works well. You can see some sources we recommend on the Favorite tools page.
Removing background from images
To remove background images, I like to outline the part of the image that I want and use the
cliptool. I created a short (silent) YouTube tutorial to show you how to do this. Click the image below to watch it.
To re-size images with Inkscape, you can create a background of your desired size and export it with your image. I created a (silent) YouTube tutorial for how to do this. It is available by clicking the image below.
It is also reasonably simple to edit images using
Previewon a Mac. To begin, open the file you want to edit with
Preview. Click and drag around the image to select the area you want.
You can further adjust by clicking and dragging the blue circles. Once you have the selection square the size you want, drag the square to adjust the position. Then you can hit
cmd + kto crop the image. Once the image is cropped, hit
Tools > Adjust size....
Adjust sizedialog box, close the lock icon by clicking on it. This locks the aspect ratio to make sure the image does not get distorted. With the lock closed, adjust the size of the image. When the lock is closed, you only need to adjust one dimension (height or width). The other dimension will automatically adjust to preserve the aspect ratio.
Instructions coming soon...