Playing AIFF sounds

David N. Smith (IBM) dnsmith at watson.ibm.com
Tue May 9 01:27:37 UTC 2000


At 12:58 -0700 5/8/00, John.Maloney at disney.com wrote:
>Hi, Dave.
>
>The Disney IS folks cut us off from the Internet last week in
>response to the "love bug" virus and I'm just now getting caught up.
>
>I haven't read every message in this thread carefully, so
>pardon me if someone else has already suggested the following
>explanation.
>
>I think that the file reading operations may be starving the
>the Squeak sound player process. This is especially likely if
>you do are trying to do back-to-back playing of sounds from
>AIFF files. A quick test would be pre-load all the sounds into
>memory and repeat the test. Increasing the SoundPlayer buffer size
>fixes the problem by making sure that the sound driver has a buffer
>larger than the longest disk read operation. But, as you found,
>that also increases the latency before a sound starts playing.
>
>If this is, indeed, the problem, then there are a number of
>solutions, ranging from pre-loading all your sounds into memory
>to using asynchronous file read operations. A fairly simple
>solution might be to simply make SampledSound>fromAIFFfileNamed:
>break its file read operation into smaller chunks to allow the
>sound player process to slip in and generate the next output
>buffer when it needs to. (Right now, I believe it reads the
>entire samples chunk in a single file read operation.)
>
>Sorry that you've had these problems...
>
>	-- John
>
We've managed to duplicate the problem with a built-in sound using DoIt:

	SampledSound playSoundNamed: 'clink'

>From a workspace or text area, select this line and do Control-D carefully and repeatedly. Sometimes there are two or more sounds. I hit it so that there should be a sound once a second or a bit less. I hit the key solidly but more than rapidly enough that there is no chance of key repeat.

Increasing the SoundPlayer BufferMSecs to 500 solves the problem at the expense of a half-second delay in the start of the sound, but I need sounds that start 'immediately'.

My next step is to upgrade to 9.0 4 and see if that solves the problem.

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