[Pkg] The Trunk: Sound-wiz.18.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Apr 29 23:01:53 UTC 2010

A new version of Sound was added to project The Trunk:

==================== Summary ====================

Name: Sound-wiz.18
Author: wiz
Time: 28 April 2010, 4:08:23.052 pm
UUID: 234c49bf-dace-4b55-83b1-beee75a189de
Ancestors: Sound-nice.15

Ok this is a resubmission of String>>sound now names
String>>#asSound in compliance with Bert's preference.

I have fixed the nits. 

I have discussed why I believe this is the right word rather than asSound on the mailing list. Squeak-dev 2010. I have not heard back from Bert. He still is in favor of this form over my preference.  Authority matters so we are now in compliance.

"'click' asSound play" will play a click sound from the sound library.
Any name missing from the sound library will return a default sound to be played. Currently the default is the same as Beeper default.

The purpose of the selector is to be a facade to allow access to sounds by name. Currently this only covers the Sampled Sound sound library and the default sound. 

However, the contract is only that
" 'name' asSound "
return a playable object. So in the future this could be expanded to check other sound libraries as well before relying on the default.

=============== Diff against Sound-nice.15 ===============

Item was added:
+ ----- Method: String>>asSound (in category '*sound-synthesis') -----
+ asSound
+ 	"Return a sound. Either from the sound library via SampleSound or
+ 	else the Beeper default"
+ 	^ SampledSound
+ 		soundNamed: self
+ 		ifAbsent: [Beeper default]!

More information about the Packages mailing list