More sounds

John.Maloney at John.Maloney at
Mon Dec 17 12:44:44 PST 2001


[Oops, I just saw that Mark Guzdial already answered your question.
But I'll send this anyhow since it has a second way to do what you want.]

There are two ways you can do this. First, you can use the Squeak sound
recorder (create a "RecordingControlsMorph" from the object palette or
the alphabetical "new morph..." menu). Plug in a microphone or use the one
built into your computer--many laptops have built-in mics. Click on the
"Record" button, make a sound, click the "Stop" button, then click "Play"
to see if you got what you wanted. You might need to adjust the record
level slider. You can use the "Trim" button to get rid of leading or trailing
silence. Finally, click the "Tile" button. You will be prompted for a name
for the sound. The sound will be added to the sound library with this name.
You can then delete the tile that was created and the sound will remain
in the library. To make it persist, you'll need to save the image using
the "save" command in the world menu. (The sound library lives in
the Squeak image file; if you quit the image without saving it, any sounds
you've added in that session disappear.)

Second, if you're comfortable typing some Squeak code and if you've
got the sounds you want in an AIFF file, you can execute the following:

	addLibrarySoundNamed: 'bark'
	fromAIFFfileNamed: 'bark.aif'.

If your sound is in a WAV file, you can execute:

  snd := SampledSound fromWaveFileNamed: 'bark.wav'.
	addLibrarySoundNamed: 'bark'
	samples: snd samples
	samplingRate: snd originalSamplingRate.

To use the above, open a "workspace" window, paste the code into it,
and edit it to use you file name and sound name. Then select all the lines
of code and select "do it (d)" from the workspace menu. The "(d)" means
you can also use "alt-D" (Win) or "cmd-D" (Mac) as a keyboard shortcut.

Again, you must save your image to make these additions persist. You should
keep a backup copy of the original image just in case you need to go back to it.

Hope this helps.

	-- John

At 12:57 PM +1300 12/14/01, Christopher Sawtell wrote:
>Greetings folks,
>  I would love to add some more sounds to the e-toy tools.
>   (dog barking and dice being thrown)
>  Please could a kind soul direct me some doco about how to do this
>Sincerely etc.,
>Christopher Sawtell.

More information about the Squeakland mailing list