Playing AIFF sounds

David N. Smith (IBM) dnsmith at watson.ibm.com
Fri May 5 17:10:19 UTC 2000


At 19:21 -0400 5/4/00, Bob Arning wrote:
>Dave,
>
>On Thu, 4 May 2000 17:33:12 -0400 "David N. Smith \(IBM\)" <dnsmith at watson.ibm.com> wrote:
>>	lastSound isNil ifFalse: [
>>		SoundPlayer waitUntilDonePlaying: lastSound ].
>[...snip...]
>>	lastSound := name
>
>I don't know if this was a typo in sending the message, but <lastSound> should be the sound, not the name for #waitUntilDonePlaying: to work correctly.

OOps, yes, a 'typo'. I fixed it and it made no difference.

>Have you checked that "Allow processor cycling" is OFF in the Energy Saver control panel? This can sometimes mess with sound.

Yes, it's off. I went and checked again just to be sure something 'helpful' hadn't been around and turned it on.

>Another experiment: increase BufferMSecs in SoundPlayer class>>initialize
>
>initialize
>	"SoundPlayer initialize; shutDown; startUp"
>	"Details: BufferMSecs represents a tradeoff between latency and quality. If BufferMSecs is too low, the sound will not play smoothly, especially during long-running primitives such as large BitBlts. If BufferMSecs is too high, there will be a long time lag between when a sound buffer is submitted to be played and when that sound is actually heard. BufferMSecs is typically in the range 50-200."
>
>	SamplingRate _ 22050.
>	BufferMSecs _ 120.		"<<<try increasing this??"
>	Stereo _ true.
>	UseReverb ifNil: [UseReverb _ true].

I tried both 200 and 50, and except for the startup delay differences, there was no change in the multiple sounds.

I still get extra sounds. Today they've all been four at a time, yesterday most were three. They happen rapidly and there is no refetch of the sound from disk.


(later) I tried it with reverb on and it still gets multiple sounds. The loudest sounds happen first, then the reverb. (It's possible that there is reverb from each time the sound plays but it's hard to tell.) I think I get:

	POP,	Pop,	pop,	p..
		POP,	Pop,	pop,	p..
			POP,	Pop,	pop,	p..
  Time ->	1	2	3	4	5	6

(POP is louder than Pop which is louder than pop which is louder than p.., etc.)

It looks like there is no connection with reverb.


(later) Try this:

	SampledSound playSoundNamed: 'clink'

Select it, and press Command-D repeatedly but carefully. It shows the same property: every so often it plays multiple sounds with one key press. (I have reverb off.) This is a builtin sound and does not go thru my code at all. We got ghosts!

>
>Cheers,
>Bob


Thanks,
Dave
_______________________________
David N. Smith
IBM T J Watson Research Center
Hawthorne, NY
_______________________________
Any opinions or recommendations
herein are those of the author  
and not of his employer.





More information about the Squeak-dev mailing list